Susan,
I am sure there are other public water systems that operated differently, but here are two that I am familiar with:
You may notice in your community a tall standing water tank; the size is likely determined upon local needs, finances and the size of the pumping station. The way many of them work is, during the night when electrical and water usage is at it’s minimum, pumping stations will pump water up into these large water tanks/towers. By pumping the water into these tanks/towers, the water has potential energy via gravity to pressurize the water distribution system in your community.
If the electricity was out for any significant period of time or there was no electricity at all, the other way water could reach a home/business on public water system is if a reservoir was located higher then the city/town it was supplying water and then again via gravity water would be funneled into the distribution system.
Pete