An oscillator makes a steady sine wave by itself, from nothing but a DC supply. It is the heart of every radio: the transmitter's carrier, the receiver's local oscillator and the clock of every digital circuit all begin as an oscillator.
How it works
Voltage across the tank, kicked once at the start. Q sets how many cycles the ringing lasts.
Cycles to fall to 10%14.7
A tuned circuit (a coil and a capacitor) swaps energy back and forth at its resonant frequency, but its small resistance steals a little each cycle, so the ringing dies away. An oscillator adds an amplifier that takes a sample of the output and feeds it back in phase to replace exactly what was lost.
Part of the output is fed back to the input. Each trip round the loop multiplies the signal by the loop gain.
After 6 trips1.00× start
Two conditions must hold: the feedback arrives in phase with the signal, and the loop gain (amplifier gain times feedback fraction) is at least 1. Only the tuned circuit's frequency satisfies the phase condition, so that is the frequency you get. Start-up is from random noise: with loop gain a little over 1 the noise grows until the amplifier runs out of room and limits, which settles the gain at an effective 1.
Kinds of oscillator
Orange = where the feedback comes from: a capacitor divider, a tapped coil, or a crystal.
A VFO (variable frequency oscillator) tunes an LC circuit with a variable capacitor or inductor. A crystal oscillator gets its frequency from the mechanical vibration of a quartz slice, which has an enormously higher Q than any coil, so it is far more stable. See Crystals and resonators.
In practice
Drift is slow wander as parts warm up. LC oscillators use temperature-stable (NP0 or C0G) capacitors, a rigid build and a regulated supply. Crystal types add temperature compensation (TCXO) or a heated oven (OCXO), each better than the last.
Buffer the output. A following stage isolates the oscillator from changes in its load; otherwise tuning the next stage pulls the frequency.
Purity counts. Noise on the oscillator (phase noise) is copied onto every signal it mixes, and it limits how well a receiver copes with strong neighbours; see Sensitivity, selectivity and dynamic range.
Accidental oscillation is any amplifier with enough stray feedback, such as a power amplifier squealing at its own frequency. Layout, bypass capacitors and neutralizing cure it.