Mathematically, density is defined as follows:
Each rectangle has the same volume. Let's assume that this
volume is 20 mL. Each brown spot weighs 1 gram. So the density
of the upper rectangle is the sum of the weights of the brown spots divided
by the volume:
And the density of the lower rectangle is:
The lower rectangle has a much lower density
because there are fewer brown spots in the same unit of volume.