That is an expansion tank. discussed quit a bit here. Do a search and see what you come up with. Water does not compress when you heat it up. Pressure will increase when a closed system of water is heated. The tank has an air bladder. the air bladder will compress to prevent excessive pressure rise in system. T&P is a safety valve in case the pressure gets to high that the tank bladder can't handle
That's a thermal expansion tank. That's there to cushion the system when water is heated. When the system is heated, there's an increase in pressure and volume as opposed to when it was cold. The bladder in the tank stores/cushions the increase until things cool down.