How does water flow through my water heater and up to the top floor without a pump?
The water coming to your home is under pressure. Typically about 60 psi. 

Imagine a bucket with a lid and in the lid you have two holes cut. In one hole, you place a garden hose that fits snugly. You turn the water on and the bucket begins to fill. When the water reaches the top of the bucket, it will start to come out of the second hole.

Your water heater works the same way. The tank has two holes. One for water in and one for water out. The water coming into the tank will push water out of the outlet and up through your house because of the pressure.