The depletion region in the P-N junction region is caused by
The majority carriers on either side of junction try to move to the other side because of difference in charge carrier density, which is called diffusion. While diffusing they combine with opposite charges and become neutralised around the junction leaving a region without charges, which is called depletion region. Because of this region a potential barrier is formed which prevents further diffusion of majority carriers and recombination of charges.