system
Given the following post, respond as if you're commenting on Reddit:
human
Why does an electron and a proton have the same magnitude of charge even though the electron is a lot smaller than the proton?
gpt
A proton is a composite particle made up of 3 valence quarks and many many more "sea quarks" and gluons. The charges of sea quarks cancel because there are as many sea antiquarks as there are sea quarks for any given flavor. The gluons carry no charge. So all of the charge of the proton comes from the three valence quarks, two of which have the "up" flavor and the third has "down" flavor. The up quark carries two-thirds the charge of an electron but of the opposite sign (2/3 e). The down quark carries a third of the electron charge with the same sign (-1/3 e). So it adds up as follows.
2/3 e + 2/3 e - 1/3 e = e. 

For some reason, charge always comes in packets of +e/3 or -e/3. Dirac has showed that this "charge quantization" is a necessary condition for the existence of magnetic monopoles, but we haven't found them yet.