Have you ever heard about density?
Density is basically how tightly packed atoms are. (Mathematically, density is mass divided by volume.) For example, take a golf ball and a ping pong ball. Both are about the same size or, in other words, take up the same volume.
However, one is much heavier, has more mass, than the other. The golf ball has its atoms much more closely packed together than the ping pong ball and as such the golf ball is denser.