When you have a body of water at each point is the water the net force is zero - you have static equilibrium.
Imagine a beaker ABCD with a hole in the bottom BC being held partially immersed in some water as shown in the left hand diagram.
The water pressure at the bottom of the beaker is determined by the vertical height of water.
There is static equilibrium at each point in the water and the beaker.
Close the hole - nothing changes with the pressure due to the water at the bottom of the beaker still the same.
Remove the water surrounding the beaker.
Nothing inside the beaker changes.
How is it that the water stays in the beaker?
The walls of the beaker exert forces on the water in the beaker which before were exerted by the surrounding water.
The pressure of the water on the base of the beaker is still determined by the vertical height from the base of the beaker to the surface of the water.
So now go through the same sequence for the vessel with the shape EFG to show that the water pressure at F is determined by the vertical height between F and the surface of the water.
With the water removed from the outside of the container the walls of the container exert forces on the enclosed water equal to those which had been exerted by the surrounding water.