>>11231473Because the only force attracting electrons to the nucleus is the Coulomb force via electromagnetism (and gravity in a negligible way), which causes opposite charges to be attracted the closer and stronger they are, meaning the electron needs the least energy to resist it the closer it is. The momentum uncertainty makes it so the electron's energy rapidly rises if confined to too small a spot. The balance between these forces and laws has a minimum energy level - which places the electron at a certain radius, corresponding to its orbital. In the Hydrogen atom, its the Bohr radius.
In the nucleus you have two repelling effects. The Coulomb force between positively charged protons urges them to spread away with immense force. At the same time, all nuclear particles have an insane confinement energy due to the increased momentum they have due to being spatially restricted. However, there is a force more powerful that holds both in check: the strong nuclear force. If it were removed, the electromagnetic energy and momentum locked in the nucleus would be unleashed. Nuclear bombs are devices that use chain reactions to quickly unlock many unstable nuclei.