We know that in the n-type material electrons are the majority carriers and in the p-type material holes are the majority carriers. When a p-n junction is formed, due to this charged inhomogeneity some of the free electrons of the donor atoms on n-side will diffuse across the junction plane to the p-side where they fill valence levels created by the acceptor atoms. The net effect of the diffusion of the carriers across the junction is the creation on each side of the junction of a thin layer that is depleted (emptied) of mobile charge carriers (i.e. free electrons and holes). This is called depletion layer. Thus the diffusion of carriers across the junction is the cause of depletion layer. When p-n junction is forward biased, the width of depletion layer decreases and when it is reversed biased, the width of depletion layer increases.