Images to graphically describe what I believe David Bailey's answer is explaining.
Gravity doesn't just pull down. It also pulls sideways. When gravity is equal everywhere, the vertical and horizontal components cancel out, for a flat surface.
When gravity is unequal, there's less vertical pressure on the water, but there's also less force pulling inwards. So the high-gravity areas around the low-gravity area are able to pull the water sideways, away from the low-gravity area.
More images to graphically describe what I believe user253751'a answer is explaining.
Water follows an imaginary surface of equal gravitational potential. Imagine two different sources of gravity with different strengths. Both objects will have strong (red) gravity closer, and medium (orange) and light (yellow) gravity further out. But the radius at which the high gravity object pulls with a given strength is farther away from the center of the object.
If we move the objects close together, their gravitational fields merge.
Gravity is additive, so the fields smooth each other out where they connect.
Water follows the gravity field at some level. In this case, I drew it slightly farther than "light" gravity, but in reality it will be whatever level has enough volume beneath it to hold all the water.