The "lime" in limelight has nothing to do with the green fruit. It is quicklime, calcium oxide, and the light came from heating it until it glowed.

The idea was simple. A flame fed by oxygen and hydrogen was directed at a cylinder of quicklime. The lime did not burn away like a candle. It was heated to incandescence and gave off an intense white light, which a lens could focus into a beam.

Goldsworthy Gurney found the effect while working with the oxy-hydrogen blowpipe. Thomas Drummond saw a demonstration by Michael Faraday in 1825 and realized it would be useful for surveying. He built a working version in 1826, and the device is sometimes called the Drummond light. Merriam-Webster's account dates Drummond's invention to 1816 instead. Drummond was born in 1797, so the later dates seem likelier. Merriam-Webster adds that it proved too expensive and dangerous for lighthouse use.

Theaters came next. The earliest known public show was outdoors, over Herne Bay Pier on 3 October 1836. Covent Garden Theatre in London first used limelight to light an indoor stage in 1837. It spread to theaters around the world in the 1860s and 1870s, where operators used it much like a modern spotlight to pick out a single performer.

Electric arc lighting gradually replaced it in the late 19th century. The name outlived the hardware. Merriam-Webster's earliest figurative example is from the Indianapolis Journal of 5 April 1903, about a woman who had "no wish, nor ever had, to stand in lime-light." By 1920 Van Wyck Brooks could write of Mark Twain's "passion for the limelight."

The lime itself is an old English word. It comes from Old English lim, first used for birdlime, a sticky substance for trapping birds, and later for calcium oxide. The fruit is a separate word, borrowed from Arabic through Spanish and French. Spotlight, from the early 20th century, has since taken over the same figurative job.