Plumbing works because water is kept under pressure within the pipes. If a water main connection runs into the basement of a house, the water still flows on the second floor because of the pressure. In ancient times, this pressure was created by the force of gravity. In modern times, this is done with powerful pumps instead.