How does the Windows Phone manage running apps and switching between those? What is the basis for restriction on the number of apps that can be switched?
When you leave an app by going back to the home screen (using the windows button) the state of the app is frozen. when you return back to the app it retrieves the state from memory and continues where it was. The restriction on how many apps will be left open is dynamic because the OS will decide if these apps should be removed if it needs the memory for something else.
When you close / exit an app by pressing the back button you will shut down the app and it will be removed from memory.
some exceptions are there when you have background music. this will run in a different thread so can keep on going.
Iphone and Android have a similar aproach where apps will just be frozen in a "tombstoned" state where the state of the application is saved. this is mainly because all apps are running full screen or not so you don't really need full multitasking.
On android it is possible to have processes running in the background when the app is not running where on Windows Phone and Iphone this is not possible. Microsoft made this choice because these processes can use a lot of battery and are hard to maintain for users.
On Windows Phone you can have some background tasks but these run max 1x each 30 minutes instead of always what is possible at android. Also there is a soft cap of how many background tasks can be active on a device (depending on the device, lowest is 6 for 512 MB devices and 0 for 256 MB devices.
The app goes to a sleeping state. It keeps in memory but stops to give to it processor time.
When you return to app it return to receive processor time to do its thinks.
If an app consume more memory than available or the phone needs more memory, it can send the app to a "tombstone" state, where it lose the RAM it uses. The app need to save the information in use before this happens, else all data will be lost.
Microsoft choose this number of simultaneous apps by performance principles.
An app in background does nothing.