Answer:
As indicated by the first law of thermodynamics, energy is not created or destroyed, it only transforms.
In the case of a fluid flowing through a pipe there are two energies, the static energy which is related to the pressure and the kinetic energy of the fluid which is related to the velocity.
When a fluid flowing through a pipeline has a restriction (decrease in flow area), its speed and kinetic energy increase while its pressure and static energy decrease.
On the other hand, if the flow expresses an expansion, the speed and kinetic energy decrease but its pressure and static energy increase.