The mass of a particle is not solely determined by its charge or spin. The mass of a particle arises from its interaction with the Higgs field, which is a quantum field that permeates the universe. The Higgs field provides mass to particles through a process called electroweak symmetry breaking.
In the Standard Model of particle physics, which describes the fundamental particles and their interactions, the electron is an elementary particle with a non-zero mass, whereas the proton is a composite particle made up of quarks. The mass of a proton is primarily attributed to the strong nuclear force that binds its constituent quarks together.
The strong nuclear force is one of the four fundamental forces of nature and is responsible for holding atomic nuclei together. It is mediated by particles called gluons, which interact with quarks. The energy associated with the strong force, as described by Einstein's famous equation E = mc^2, contributes to the overall mass of the proton. The quarks inside the proton are in constant motion, and the energy and momentum associated with their motion also contribute to the mass.
In contrast, the electron is an elementary particle with no known substructure. Its mass arises from its interaction with the Higgs field. The strength of the interaction between the electron and the Higgs field determines its mass. The electron's charge and spin do not directly affect its mass but are properties related to its electromagnetic interactions and intrinsic angular momentum, respectively.
Therefore, the differences in mass between the proton and the electron can be attributed to the nature of their respective particles and their interactions with the fundamental forces and fields described by the Standard Model of particle physics.