A semiconductor is a purely crystaline material that can display qualities of both an insulator (no conductivity) and a conductor (full conductivity). It is the combination of these qualities that makes it an effective part of electronic circuits. Among the popular semiconductors are silicon, silicon carbide, selenium, lead sulphide, germanium, and gallium arsenide.
To understand how a semiconductor works, you have to know how electrons are arranged in an atom and how they move.
Atoms have electrons that are arranged in layers called shells. The valence shell (the outermost layer) is the one that we will be focusing on. Any electron in this shell is able to form bonds (called covalent bonds) with nearby atoms. Conductors usually have atoms with only one electron in its valence shell – which ends up being a free electron.
Semiconductors have four electrons in the valence shell. If the nearby atom is of a similar type, the electrons in their valence shell will bind with each other. Only one electron can bond with another atom and that means the 4 electrons in the atom of a semiconductor will bond with 4 other atoms. This ends up looking like a crystal structure. This is why the most popular semiconductor are silicon crystals.

There are 5 interesting properties of semiconductors that makes it an effective part of an electric circuit.
Flexible conductivity. In the crystal like state, the semiconductor is like an insulator – or at the very least, a very poor conductor. This is because they only have enough electrons to form valence bonds. But, there are techniques used like doping or gating that transform semiconductors so it frees up electrons. This can either be done through excessive or deficient electrons. The unpaired electron becomes a free electron and that modifies the semiconductor to be an effective conductor.
Creation of depletion region. If a doped semiconductor is joined with other metals, or other semiconductors (either a different type or the same but with different doping), this results in the stripping of the free electrons. These unpaired electrons are stripped out of the semiconductor and into a nearby junction. This creates a depletion region that allows current to flow in one direction (also see diode). This allows the shaping of electrical currents in semiconductor devices.
Allows electrons to travel far before dissipating into heat. While this is also possible in metal conductors, semiconductors allow energy to travel much further before dissipating into heat. This allows it to be the better alternative for similar to bipolar junction transistors and the like.
Ability to emit light. Another property of semiconductors is its ability to relax excited electrons through the emission of light instead of heat. This is useful in creating light emitting diodes.
Conversion of thermal energy. Semiconductors have large thermoelectric power factors that is useful for thermoelectric generators. They also have high thermoelectric figures of merit that become useful for thermoelectric coolers.
All of these properties mean that semiconductors allow the creation of devices that have amplified electrical signals and controlled energy.