A P-N junction is created in a single semiconductor crystal by doping one side as a p-type and one as an n-type. The region where the two types converge is known as the p-n junction.
The extra electrons that were added to the n-type semiconductor move towards the p-type junction side while the holes added through p-type doping are positioned closer to the n-type junction.
As electrons leave the n-type region, it becomes positively charged. This process is called diffusion. The depletion region is the area between the p and n-type sides. The state of equilibrium in the p-n junction is the state of the depletion region without any external electrical potential applied. As mentioned before in a previous paper, the Fermi level is the average between the conduction band and the valence band. By altering the levels of electron holes and electrons in the p-type and n-type sections, holes drift toward the the n-type side and electrons move towards the p-type side, which causes both sections to be closer to the Fermi level in their regions of the material.
When voltage is applied to the pn junction, electrons and electron holes from either side tend towards equilibrium. If the positive potential is applied to the p-type and it is more positive than the n-type area, holes will travel towards the negative voltage. Through diffusion, electrons or electron holes may jump through the depletion layer. For the reason however that electron holes (positive charge) may only move in the direction of the n-type region and electrons (negative charge) may only move in the opposite direction. The direction of electron flow, due to their negative charge is opposite the conventional direction of current flow. Since electrons are only moving from the n-type region to the p-type region, it can be understood that current will only move in the direction going from the side of the p-type region towards the n-type region.