p-n Junction
When an n-type and p-type semiconductor are slapped together, electrons from the n-type migrate over the junction and into the holes of the p-type while holes simultaneously immigrate into the vacancies left by the electrons of the p-type. Such a joining of an n-type and p-type semiconductor results in what is known as a p-n junction.
The impurities, locked in the lattice structure, gain an electron in the case of a p-type material and lose an electron in the case of an n-type material. A potential therefore arises across the junction which oppses any further current flow.
The area in which the electric field is established is referred as the depletion region since no free electrons or holes exist there.