N-semiconductor has a free electron that does not fit in the lattice, as a group 5 element has been added and the 5th electron will not fit in the lattice.
P-semiconductor has a hole in the lattice where a Group 3 element is and cannot share an electron.
When an n is placed next to a p, some of the free electrons will move and fill in the holes in the p semiconductor. This forms a connection area with no p-type free electrons or n-type positive holes.
This area is the depletion zone.