Here's why:
* Liquids are incompressible: Unlike gases, liquids resist compression. Their molecules are packed closely together, and applying pressure doesn't significantly reduce the spaces between them.
* Gravitational force is negligible: While gravity pulls on the liquid, the force is distributed evenly throughout the liquid's volume. This means the weight of the liquid above doesn't significantly compress the liquid below.
However:
* Pressure does vary with depth: Even though the density is uniform, the pressure at the bottom of a container is greater than at the top. This is due to the weight of the liquid above.
* Surface tension: The surface of a liquid behaves differently than the bulk of the liquid. Surface tension causes the surface to act like a thin, elastic membrane. This can cause slight variations in density at the surface.
In summary:
While pressure and surface tension can have minor effects, the density of a liquid is essentially constant throughout its volume, regardless of its position in a container.