Physics is often about recognizing patterns, sometimes repeated across vastly different scales. For instance, moons orbit planets in the same way planets orbit stars, which in turn orbit the center of a galaxy.
When researchers first studied the structure of atoms, they were tempted to extend this pattern down to smaller scales and describe electrons as orbiting the nuclei of atoms. This is true to an extent, but the quirks of quantum physics mean that the pattern breaks in significant ways. An electron remains in a defined orbital area around the nucleus, but unlike a classical orbit, an electron will be found at a random location in the area instead of proceeding along a precisely predictable path.
That electron orbits bear any similarity to the orbits of moons or planets is because all of these orbital systems feature attractive forces that pull the objects together. But a discrepancy arises for electrons because of their quantum nature.
