The atom of most elements have proton and neutron located in the nucleus while the electron resides in the outer part of an atom.
The proton are usually positively charge and tends to repel one another in the nucleus of an atom. The reason for the repel of the proton is the positively charged nature. The neutron has no charge because they are neutral. The neutron are usually heavier than the proton . The sum of the proton and neutron contributes mostly to the mass of an atom. The electron that revolves and reside at the outer part of an atom is negatively charge.
The picture above is a representation of how the proton, electron and neutron is located in an atom.
Different substances have different molecular masses. Thus, equal masses have different numbers of atoms, molecules, or moles. On the other hand, equal numbers of moles of different substances have different masses.