Expansion tanks function on the principle of thermal expansion, stating that water expands when heated. When the water tank is heated its volume will expand significantly and the overflow will spill into the expansion tank, which is attached to the water supply pipe and prevents the water pressure of the main water tank from getting too high.
The thermal expansion tank is attached to the water supply pipe from which the water tank's overflow travels through. Because water is noncompressible, the pressure builds as it expands. This means that the pressure could damage the water supply pipes, valves and water heater itself if an overflow outlet is not available. Thus, the thermal expansion tank, which is filled with compressible air, is used as an overflow tank to relieve the pressure when the water volume increases past the volume of the water tank. This allows for the water pressure of the system to remain fairly steady.
In the case that the pressure increases too much, the water system is equipped with check valves on the water service pipe, which help to reduce pressure to avoid water flowing back into the home. If the check valves or expansion tank are not functioning properly, a plumber should be called to check the system and prevent potentially serious damage to the water heater.