Simplifying, the solubility of water in rhyolite and basalt is function of pressure and depth below the surface in absence of other volatiles. Both basalt and rhyolite lose water with decreasing pressure as the magma rises to the surface. The solubility of water is higher in rhyolite than in basaltic magma. Knowledge of the solubility allows the determination of the maximum amount of water that might be dissolved in relation with pressure. If the magma contains less water than the maximum possible amount, it is "undersaturated" in water. Usually insufficient water and carbon dioxide exist in the deep crust and mantle, so magma is often "undersaturated" in these conditions. Magma becomes "saturated" when it reaches the maximum amount water that can be dissolved in it. If the magma continues to rise up to the surface and more water is dissolved, it becomes "supersaturated". If more water is dissolved in magma, it can be ejected as "bubbles" or vapor water. This happens because pressure decreases in the process and velocity increases and the process has to balance also between decrease of solubility and pressure. Making a comparison with the solubility of carbon dioxide in magma, this is considerably less than water and it tends to exsolve at greater depth. In this case water and carbon dioxide are considered independent. What affects the behavior of the magmatic system is the depth at which carbon dioxide and water are released. Low solubility of carbon dioxide means that it starts to release bubbles before reaching the magma chamber. The magma is at this point already supersaturated. The magma enriched in carbon dioxide bubbles, rises up to the roof of the chamber and carbon dioxide tends to leak through cracks into the overlying caldera. Basically, during an eruption the magma loses more carbon dioxide than water, that in the chamber is already supersaturated. Overall, water is the main volatile during an eruption.