Before I was enlightened, I thought that a computer uses the swap/virtual memory to store newly opened applications that the RAM could no longer hold. I think that is partially correct. But I learned that a better way of thinking of this is that when your applications goes idle, the memory that the idle application uses is then swapped into the hard disk/virtual memory. In Mastering EJB, 3rd edition, this was termed as Context Switching.
This is important in the EJB world as this concept is used for Stateful Session Beans, which hold a lot of data/resources.