You can do this because it takes more pressure from the pipe to flow water to the upstairs tap than the amount of pressure it takes to flow water to the downstairs tap. This is clear in Bernoulli's Equation:The fancy-looking p (pronounced rho) in the first two terms represents thedensity of the liquid, v represents the velocity in which the fluid is traveling, g is the acceleration due to gravity (appx. 9.8m/s^2), and z is the difference in height traveled by the fluid, the final P represents the atmospheric pressure (101.3 kPa). As you can see, as the value of variable z decreases, it allows for the only other variable, v, to increase. This explains why, at a higher elevation and a constant force applied to the fluid, water will flow faster at a lower height than a higher point.EDIT: It won't let me add an image for some odd reason, search Bernoulli's Principle and look for the phrase, "By multiplying with the fluid density", and reference the equation underneath for a more complete understanding of what I just said.