A magma chamber is like a giant bubble of liquid rock beneath the surface of the earth. When the mantle/tectonic plates shift (they do this over a long time) pressure builds and forces magma to burst through cracks from beneath the crust because it is less dense than the surrounding rock. When the magma cannot find a path upwards it pools into a magma chamber. As more magma rises up below it, the pressure in the chamber increases. If magma resides in a chamber for a long period, then it can become stratified with lower density components rising to the top and denser materials sinking. It can also start to cool, with the higher melting point components such as olivine crystallizing out of the solution and forming a denser conglomerate of minerals which sinks. For example the deposits from the 79 AD eruption of Mount Vesuvius include a thick layer of white pumice from the upper portion of the magma chamber overlaid with a similar layer of grey pumice produced from material erupted later from lower down in the chamber.