system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: If protons repel each other, how do they all stay all together in the nucleus of an atom?
gpt
You have two competing forces here: there's electromagnetism, which tries to push the protons apart and there's the strong nuclear force which tries to hold them together. As the name would suggest, the strong force is much stronger, but only over short distances. Get too far away and it is almost impossible to see. 

Think of it this way. You have a T-Rex trying to compress a spring. The T-Rex is very strong but it has tiny little arms, so it can't reach very far. If the T-Rex can manage to grab the ends of the spring, it can force them together even though the spring really wants to extend. However, if the ends of the spring are too far apart, the T-Rex can't grab the ends and the spring extends like it wants to. 

This is also why heavier nuclei (like uranium) have more neutrons than protons versus light nuclei (like carbon), which tend to have about an equal number. Once the nucleus gets too big, the strong force can't really reach everything and starts to have a hard time competing with the electromagnetic force, so it will prefer lots of neutrons over protons.