In ‘classical’ physics you’d expect just that to happen – the electron gets attracted to the positive nucleus end of story. That’s one of the reasons we know classical mechanics isn’t all that good a description of reality!
In quantum mechanics the electrons have a probability of being in the orbitals around the nucleus. Once they are in the lowest shell they have the lowest energy state possible and have nowhere lower to go!
It sounds strange because we’re used to dealing with the electromagnetic force over large distances, but this is over very small distances where quantum mechanics dominates!
yeah, this one confused a lot of people back in the day. The solution is quantum physics! The electron can’t be considered as point like objects, as the uncertainty principle dictates you can’t confine their location, and therefore they exist in this probability cloud. They exist in energetically stable orbitals of defined energy – as to why these are stable, we don’t know.