The proton and the electron indeed have significantly different masses despite both carrying an electric charge. This is because the masses of particles are determined by various factors, including the properties of the particles themselves and the interactions with other fundamental particles and fields.
The mass of a particle is closely related to its interaction with the Higgs field, which is responsible for giving particles mass. According to the Standard Model of particle physics, particles acquire mass through their interaction with the Higgs field, mediated by the Higgs boson. The strength of this interaction is often referred to as the coupling strength.
In the case of the electron, its mass is primarily determined by its coupling strength to the Higgs field. The electron has a relatively small coupling strength, which results in its comparatively low mass.
On the other hand, the proton consists of three quarks: two up quarks and one down quark. The masses of the up and down quarks are relatively small compared to the proton's mass. However, the majority of the proton's mass does not come from the quark masses alone. The strong force, mediated by particles called gluons, holds the quarks together within the proton. The strong force is much stronger than the electromagnetic force, which is responsible for the interaction between charged particles. The energy associated with the strong force and the binding of the quarks contributes significantly to the proton's mass.
Therefore, while both the proton and the electron have the same electric charge, their masses differ due to the complex interplay of fundamental particles, interactions, and fields within the framework of the Standard Model of particle physics.