Why is the number of protons and electrons equal in an atom?
Actually the proton and electron count of an atom are equal only when the atom is neutral in charge.
The three atomic particles of an atom are the protons, which carry a positive charge, the electrons which carry a negative charge and the neutrons which have no charge. The proton number is always the same as the atomic number for the element.
The protons and neutrons are found in the nucleus of the of the atom and make up the major it of the mass of the atom. The electrons are found in orbitals surrounding the nucleus.
In order for the atom to remain electrically neutral the protons and electrons must balance each other.
Two examples would be Sodium (Na) and Chlorine (Cl)
Sodium has an atomic number of 11 and an amu of 23
Sodium has 11 protons 12 neutrons and 11 electrons.
11 protons - atomic number 11
11 + 12 = 23 the amu
Chlorine has an atomic number of 17 and an amu of 35
Sodium has 17 protons 18 neutrons and 17 electrons.
17 protons - atomic number 17
17 + 18 = 35 the amu