How Does a Lamp Work?

The bases of most lamps are similarly constructed. Essentially, the base is just a stand with a wire running through it. The purpose is to run an electrical current through the light bulb; a cutoff switch that stops and starts the flow of electricity at the owner's whim is a bonus. It is the bulb of a lamp that needs the most explanation.

...
How Does a Lamp Work?

Incandescent Lamps

...

Incandescent bulbs are the cheapest and most commonly found in any residence. They are bulbs of glass containing a small amount of inert gas, rather than plain air. The contact points at the base lead up into the inside of the bulb. At the center of the bulb is a wire (known as a filament) of pure tungsten. In a low-oxygen environment, tungsten becomes red hot and emits a great deal of light when electricity is run through it. It's essentially the same design that's been around since the days of Thomas Edison.

Fluorescent Lamps

...

Fluorescent lamps are classified as gas-discharge lamps, a group that numbers neon lamps and signs. They are long glass tubes filled with a small amount of mercury. In a low-pressure environment--such as a vacuum-sealed glass tube--mercury will expand and be converted to a gaseous state. This is why fluorescent lamps are also known as mercury vapor lamps. Electrodes at either side of the tube will fit into brackets, typically in a commercial or industrial building with heavy lighting needs. When electricity is run through the tube, the free electrons will interact with the molecules of mercury. They then become excited, having been infused with energy due to the impact. The electrons return to their normal state quickly, releasing the extra energy in the form of light. This is how a fluorescent light works.

Oil Lamps

...

Oil lamps were the precursors of electrical lamps, and were built quite a bit differently than what we're now used to. The base is hollow, containing flammable oil. Into the base is inserted a long, corded string, called a wick. The very top of the wick extends through the hole at the top of the oil reservoir into the open air. Because of a natural occurrence called osmosis, the wick soaks up the oil and pulls it to the very top, where it is ignited by means of a match or other fire-making tool. As long as the oil soaks the wick, the wick itself will not burn, meaning that the light it creates will last for as long as the oil does.