Why do electron and proton have the same but opposite electric charge?
Because a proton can decay to a positron. It is an experimental fact that the proton and positron charges are very close. To conclude that they are exactly equal requires an argument. If a proton could theoretically decay to a positron and neutral stuff, this is enough.
In QED, charge quantization is equivalent to the statement that the gauge group is compact. This means that there is a gauge transformation by a full $2\pi$ rotation of the fields which is equivalent to nothing at all. Under these circumstances you have the following:
- Charge is quantized
- There are Dirac string solutions which have a magnetic flux indistinguishable from no flux (the magnetic flux is the phase around a loop).
If you have any sort of ultraviolet regulator, either a GUT or gravity, the existence of Dirac strings leads to monopoles. If you don't have an ultraviolet regulator, it is consistent to make all the monopoles infinitely massive.
So the question is why is the U(1) of electromagnetism compact. There are two avenues for answering this:
- A compact U(1) emerges from a higher gauge group, because all higher gauge groups must be compact for the kinetic terms to have the right sign. Breaking a compact group produces a subgroup, which is necessarily compact.
It is also true that in any GUT theory producing electromagnetism, you get monopoles, so you automatically get charge quantization by Dirac's argument.
But even if you have a U(1) which is not part of a GUT, there are constraints from gravity. If you have particle with charge q and a particle with charge q', and they aren't rational multiples of each other, you can produce a particle with charge $nq - m q'$ by throwing n q particles into a black hole, waiting for m q' particles to come out, and letting the resulting black hole decay, while throwing back any charge particle that comes out.
This means that in a consistent quantum gravity, you need either charge quantization or a spectrum of charges that accumulates near zero. Further, in order for the theory to be consistent, a black hole made from the wee charges must be able to naturally decay to wee charged things, and barring a conspiratorial spectrum of charges and masses, this strongly suggests that the mass of the wee charges must be smaller than the charge, meaning that as the charge gets small they become massless.
So in quantum gravity, the only alternative to charge quantization is a theory with nearly massless particles with extremely tiny charges, and this has clear experimental signatures.
I should point out that if you believe that the standard model matter is complete, then anomaly cancellation requires that the charge of the proton is equal to the charge of the positron, because there is instanton mediated proton decay as discovered by t'Hooft, and this is something we might concievable soon observe in accelerators. So in order to make the charge of the proton slightly different from the electron, you can't modify parameters in the standard model, you need to add a heck of a lot of unobserved nearly massless fermions with tiny U(1) charge.
This is enough conspiratorial implausibility, that together with the experimental bound, you can say with certainty that the proton and electron have exactly the same charge.
On the level of QED and above, the equality of the charges has no theoretical explanation. But it is extremely well established experimentally, as even small deviations would add up to huge amounts of electricity in bulk matter.
On the level of the standard model, the value of the charges of the up and down quark comes from simple arithmetic from those of the proton and neutron, and hence doesn't give an independent piece of information.
On the other hand, if a unified field thoery with a semisimple gauge group were found to be valid, it would forces charge quantization, as there are only a discrete number of irreducible unitary representations (which define the possible quantum numbers = charges). This would turn an approximate equality in an exact equality, and hence prove the equality of the charges of the proton and the electron (apart from the sign). Thus it would explain this equality.
By the way, bare charges of charged elementary particles are infinite and devoid of any physical meaning.
The answer is "because". It is an experimental fact.
It is among the first data that were gathered which supported the atomic theory. If they were not the same the atoms would not be neutral, there would always be left over charge and the chemistry and atomic physics data would be different, if there were chemistry and atoms at all.
This fact together with a multitude of facts studied since a century and more, have lead to positing the standard model for particle physics. This model simplifies the information in the data in a similar way as when one knows the symmetries which describe a crystal lattice the crystal is describable by a few parameters and equations. The Standard Model of Particle physics incorporates beautiful symmetries which in the end must arise from any theoretical models about particle physics which aims to be a theory of the whole.