A magma chamber is a big pool of melted rock underground. This hot rock is lighter than the rock around it, so it rises up. If it finds a way out, it can erupt as a volcano. Finding these chambers deep down is hard, so known ones are closer to the surface.
Magma rises through cracks because it's lighter than solid rock. It collects in chambers when it can't rise further. These chambers grow bigger as more magma flows in. New magma makes old rock change and increases pressure inside.
As magma cools, minerals like olivine solidify and sink to the bottom. Different rocks form as cooling continues, like granite or gabbro. Layering can trap gases, building up pressure and making magma thicker.
Thicker magma can erupt explosively. Supervolcanoes need huge surface chambers, but it's a mystery why they don't erupt often. If a volcano erupts often, its chamber gets bigger and emptier.
Eventually, the chamber's roof might collapse, forming a caldera. Scientists use earthquakes and sound waves to find magma chambers. One famous chamber is inside a volcano in Iceland.