because in any atom the electrons are in the outer orbitals while protons are within the nucleus together with the neutrons. If energy is supplied electrons can jump to higher energy levels and leave the lower orbitals.
Especially in metals the conduction band is partially filled at room temperature with allows free flow of electrons throughout the metal thus they carry charge.
(it requires huge amounts of energy to remove a proton from the nucleus such things happen on the surface of sun).