(a) Two important processes occur during the formation of a p-n junction are (i) diffusion and (ii) drift.
(i) Diffusion: In n-type semiconductor, the concentration of electrons is much greater as compared to concentration of holes; while in p-type semiconductor, the concentration of holes is much greater than the concentration of electrons. When a p-n junction is formed, then due to concentration gradient, the holes diffuse from p side to n side (p →n) and electrons diffuse from n side to p-side (n → p). This motion of charge carriers gives rise to diffusion current across the junction.

(ii) Drift: The drift of charge carriers occurs due to electric field. Due to built in potential barrier an electric field directed from n-region to p-region is developed across the junction. This field causes motion of electrons on p-side of the junction to n-side and motion of holes on n-side of junction to p-side. Thus a drift current starts. This current is opposite to the direction of diffusion current.
(b) Zener diode is used as voltage regulator.

Any increase/decrease in the input voltage results in increase/decrease of the voltage drop across Rs without any change in voltage across the zener diode. Thus, the zener diode acts as a voltage regulator.