Diode Depletion Region Forces
Remember, all of the atoms (silicon, boron and phosphorus) are electrically neutral to begin with.

The electrons diffuse from the N side to the P side because the total system energy is slightly reduced when both kinds of dopants have complete outer shells. But this immediately creates an E field that opposes further movement. Equilibrium is reached when the energy of the E field matches the drop in system energy created by the movement. This E field is concentrated in the the depletion region, and drops off sharply outside of it.

Outside the depletion region, conduction-band electrons ARE moving about freely, but they're doing it in a way that is overall electrically neutral. The only place the dopant atoms are actually ionized (phosphorus positive, boron negative) is in the depletion region.