The atomic number of an element is determined by the number of protons in its nucleus. It represents the unique identity of an element and determines its chemical properties. However, the mass of an element can vary even when the atomic number is similar due to the presence of different numbers of neutrons.
Isotopes are atoms of the same element that have the same atomic number but different mass numbers. Isotopes differ in the number of neutrons in their nuclei while having the same number of protons. Since neutrons contribute to the mass of an atom but not its chemical behavior, isotopes of the same element exhibit similar chemical properties.
The presence of different isotopes gives rise to the concept of atomic mass. Atomic mass takes into account the average mass of all the naturally occurring isotopes of an element, weighted by their abundance. This is why elements with similar atomic numbers can have different atomic masses, as the relative abundance of isotopes can vary.
For example, carbon-12 (12C), carbon-13 (13C), and carbon-14 (14C) are three isotopes of carbon. They all have an atomic number of 6 (since they have 6 protons), but their atomic masses differ due to the varying number of neutrons. Carbon-12 is the most abundant isotope and contributes to the majority of carbon's atomic mass.
In summary, the presence of different isotopes with varying numbers of neutrons is why some elements can have different masses even with similar atomic numbers.