If you take two bodies with the same volume, the one with the greatest mass is the one with the greatest density. Density is defined as the mass of a unit of volume. Here is a receptacle with a constant volume. You can vary the number of particles in the receptacle. The more particles there are, the more mass there is and therefore the greater the density.