This is based on the principles of conservation of energy. Ignoring frictional losses, the sum pressure, potential and kinetic energy remains constant as a fluid moves along a pipe (Equation 1).
If there is no change in height, then the second term may be ignored. to give Equation (2)
For the situation above, the equations are as shown below