A tiny imaginary doorkeeper nearly broke the laws of physics.
In 1867 James Clerk Maxwell imagined a being that sorts fast molecules from slow ones through a tiny door, making one side of a box hot and the other cold without doing any work. That should be impossible. Working out why took over a century, and the answer turned out to be about information.
The second law of thermodynamics says that in an isolated system, entropy, loosely a measure of disorder, never decreases. Heat flows from hot to cold, not the reverse, unless you do work. In a letter to Peter Guthrie Tait in December 1867, Maxwell proposed a challenge. Divide a box of gas into two halves with a small hole. A 'finite being' who can see individual molecules opens the hole only to let fast molecules pass one way and slow ones the other. Soon one side is hotter than the other, apparently for free, and you could run an engine off the difference.
Maxwell, a devout man, never called it a demon; Lord Kelvin did, in 1874, meaning a helpful spirit in the Greek sense rather than a malevolent one. The puzzle became one of physics' most durable. In 1929 Leó Szilárd argued that the demon must measure each molecule, and that gaining that information costs energy, generating more entropy than the sorting removes.
That was not the end. In 1961 Rolf Landauer showed that some measurements can, in principle, be done without that cost. The escape was closed in 1982 by Charles Bennett: the demon must remember what it measured, its memory eventually fills up, and erasing information unavoidably releases heat into the surroundings. That minimum cost of erasure, known as Landauer's principle, was measured experimentally in 2012 using a single tiny particle.
Not everyone is satisfied. The philosophers John Earman and John Norton argue that these rescues quietly assume the second law in order to defend it, and Bennett has accepted their point while still holding that Landauer's principle explains how real systems behave. Molecular-scale 'demons' have since been built, and some exist in biology, but every one pays its entropy bill elsewhere.
Source: Wikipedia — Maxwell's demon · Text summarised from Wikipedia (CC BY-SA 4.0)