An ingredient’s density is its mass per unit volume. We don’t use volume because every ingredient has a different density. It is a measure of how much “stuff” is in an object in a unit volume (cubic meter or cubic centimeter). Think of it as a measurement of how tightly matter is crammed together.
One cup of water in your recipe will not weigh the same as one cup of honey or one cup of coconut oil. This is due to these ingredients having different densities. To calculate density, you take the mass and divide it by the volume.