The physical principles of semiconductor devices can be understood by considering quantum energy levels in the material. I will just give a sketchy view here and define some terminology.
Valance electrons are the electrons outside the closed shells of an atom. In silicon and germanium there are four valence electrons, arsenic has five and gallium three. The large number of valance electrons favour these elements as semiconductors.
To sustain an electric current, a material must have charge carriers that are free to move. There is some probability that an atom may eject a valence electron which is then free to move in the material. The conductivity of a material is thus a function of the number of free charge carriers per unit volume. Based on these probability densities it is common to divide materials into three categories: conductors, semiconductors and insulators.
In crystals atoms interact and bind by sharing valence electrons. The wave function is no longer associated with a single atom but extends over the entire crystal. One effect of the interaction between the atoms is that the otherwise degenerate energy levels split into closely spaced levels. Since the number of atoms is large, it is common to refer to this set of levels as a continuous energy band.
In solid materials there usually exist a valance band which is an energy region where the states are filled or partially filled by valence electrons. The conduction band is defined to be the lowest unfilled energy band. So our three materials can be characterized by their band structure. An insulator has the valence and conduction band well separated. A semiconductor has the valence band close to the conduction band - separated by about a 1 eV gap. Conductors on the other hand have the conduction and valence bands overlapping.
The interesting property of a semiconductor is that thermally excited electrons can move from the valence band to the conduction band and conduct current. Silicon and germanium have thermally excited electrons at room temperature and hence their common use in diodes and transistors.
When an electron has been excited into the conduction band, the hole left behind in the valence band is also free to move through the crystal. A quantum mechanical treatment of this effect puts the hole on an approximately equal footing with the electron. Temperature causes the thermal generation of electron-hole pairs. One of the components of the pair will add a little to the majority charge carriers. The other component of the electron-hole pair will become the minority charge carrier. Minority charge carriers limit ideal performance and increase with increasing temperature.
A common method for generating even more charge carriers in a semiconductor is by doping. That is, replacing a few atoms of the base material with atoms of a different element. These impurities will contribute an excess electron or hole which is loosely bound and hence can be excited into the conduction band by thermal energy. In N-type semiconductors the majority of free charge carriers are negative, while in a P-type semiconductor the majority are positive.