Water expands when you heat it. It has to go somewhere. Often, it just pushes back out into the supply mains, back into the street. That means that if you polute that supply, you could be polluting everyone else connected to that supply. This could come from having a garden hose sitting in a puddle and there's a hiccup in the supply pressure, a handheld shower sitting in the tub without a working vacuum breaker, or other problems. Some cities put in a check valve to prevent that. Some places need a pressure reduction valve to bring the supply pressure back down to reasonable levels. Each of those create a 'closed' system...water can come in, but can't go back out. So, when that hot water expands, it could break something, leak past worn seals, or drip out the T&P valve protecting the WH. To prevent issues when the city periodically replaces water meters, or does other service, some places madate that an expansion tank be installed. This gives that water someplace to go without stressing all of the fixtures, pipes, and hoses in the house and often discharges from the T&P valve. So...it's not a bad idea to have one, regardless.