In electronics, the depletion layer is an area between n-type and p-type semiconductors with no moving charges or open holes within it. The depletion layer forms when the n-type semiconductor is positively charged and the p-type semiconductor is negatively charged.
When an n-type and p-type semiconductor make contact, electrons from the n-type conductor move into holes of the p-type conductor, because the energy state is low. This results in more negatively charged electrons in the p-type conductor. It also leaves positively charged electrons in the n-type conductor. This balancing of charges results in the depletion layer, which prevents the future transport of electrons to lower energy states.