>>14012248Because density is a ratio of mass to volume. When the mass of a sample of substance shrinks, the volume shrinks proportionately.
Imagine a bunch of circles put end to end inside the area of a square. The number of circles in the square is like the density. Now cut the square in half. The number of circles in the square is halved, but so has the area of the square, so the ratio of circle to area size remains the same.