Fluid pressure is calculated as
$$\rho = hdg$$
where $\rho$ is fluid pressure, $h$ is depth from surface, $d$ is density of fluid and $g$ is acceleration of gravity.
It used to make sense to me for square or rectangle shaped containers since pressure means force per unit area.
$$Pressure = \frac{Force}{Area} = \frac{Fluid \space Weight}{Container's \space Bottom \space Area}$$
and
$$h \times d \times g= \frac{h\times m \times g}{v} = \frac{h\times m \times g}{h \times s} = \frac{m \times g}{s} = \frac{Fluid \space Weight}{Container's \space Bottom \space Area}$$
where $m$ is mass, $v$ is volume and $s$ is bottom area.
I thought that pressure being dependent on $h$ and not $m$ would be acceptable since $m$ is also dependent on $h$ since fluids can't go higher when they have spaces to their sides.
One big obvious mistake I made was to assume that all containers would be squares or rectangles. So, now I can't wrap my mind around the concept that pressures on tennis balls in the following image are equal.
Why are they equal when the weight (and mass) of fluid above them is obviously different?