When water is pumped through a water tube, its energy/time = power, is a constant along the pipe. The amount of water flowing across a cross section per unit time is a constant. That quantity is given by : Cross section Area * velocity.
ie., V / T = A * v
At the end of the pipes of a fountain the tubes become narrow. So the velocity increases drastically, when water comes out. So water ejects like a jet at an angle to the horizontal. So water jet goes to great heights in a parabolic path due to gravity acting downwards.
Also, the power is a constant. Power = pressure * V / T
The pressure of water at the exit of the pipe is very high.