i. Consider a p-type semiconductor connected to terminals of a battery as shown.
ii. When the circuit is switched on, electrons at 1 and 2 are attracted to the positive terminal of the battery and occupy nearby holes at x and y. This creates holes at the positions 1 and 2 previously occupied by electrons.

iii. Next, electrons at 3 and 4 move towards the positive terminal and create holes in their previous positions.
iv. But, the holes are captured at the negative terminal by the electrons supplied by the battery.
v. In this way, holes are transported from one place to other and density of holes is kept constant so long as the battery is working.