electrons and holes diffuse into regions with lower concentrations of them, much as ink diffuses into water until it is uniformly distributed. by definition, the n-type semiconductor has an excess of free electrons (in the conduction band) compared to the p-type semiconductor, and the p-type has an excess of holes (in the valence band) compared to the n-type. therefore, when n-doped and p-doped semiconductors are placed together to form a junction, free electrons in the n-side conduction band migrate (diffuse) into the p-side conduction band, and holes in the p-side valence band migrate into the n-side valence band.