An expansion tank prevents pressure increases due to thermal expansion of your water.
Thermal expansion will cause very rapid pressure increases in your plumbing system. As your water is heated it expands, your lines need to be able to relieve that pressure. If you have a “closed loop system” a Backflow device is installed on your water system that prevents your water from backflowing into the main City water system. As part of your routine home maintenance you should periodically perform a check on your expansion tank to make sure it is working properly .
You maybe able to preform the test yourself. Check out this great video we found.