Step 1: Understanding the Concept
At a p-n junction, electrons from the n-side and holes from the p-side move across because of the concentration difference.
Step 2: Formation of the layer
This movement is diffusion of charge carriers. After crossing, they recombine and leave immobile ions near the junction.
This region, empty of free carriers, is the depletion layer.
Step 3: Compare the options
Drift of carriers happens later due to the junction field, and impurity ions do not migrate. So the cause is diffusion of charge carriers, option (C).
Final Answer:
The depletion layer is caused by diffusion of charge carriers.
\[ \boxed{\text{(C) }\text{diffusion of charge carries.}} \]