It's actually same as the Windows and Linux using,when you run out of memory the App in the memory goes to SWAP file which is in the Virtual Memory,it's not acting as a actual RAMDon't get carried away with expanding your RAM. It expands (swop) at the expense of the phone's memory. BUT! Phone memory (flash technology) has a very limited (compared to RAM) number of write cycles to its cells. Using phone memory as RAM leads to its accelerated degradation and failure.
Expand RAM only when it is impossible to run the desired application.