Executions in the late eighteenth century were not a pretty sight. If you were a noble convicted of a crime you got you head lopped off by an axe, which usually took several good whacks. If you were a commoner you got the breaking wheel which was basically just getting strapped to a wagon wheel and bludgeoned to death by some creep who probably took far too much enjoyment in the creativity allowed to them by their chosen profession.
Such was the case in 1789 when the people of France revolted, hanged a shit ton of nobles, and forced King Louis XVI to form a democratically elected National Assembly to help him rule. It was a heady time for lovers of freedom in France, who set themselves to making reforms to better the lives of those not lucky enough to be born into the nobility. One of these men was Dr. Joseph Guillotin, a well to do doctor who staunchly opposed the death penalty. However, when the good doctor proposed to the Assembly that the death penalty be abolished because it was excessively cruel, his fellow delegates only heard the parts about it being cruel. Not wanting to be cruel, or at least not as cruel as the nobility, they decided it would be best to design a better way to execute people.
Enter into the picture Antoine Louis, a doctor with notably less scruples who agreed to design this better way with the help of some creepy German guy named Tobias Schmidt. Dr. Louis had some experience with an English device called a gibbet, which dropped a heavy axe on the neck of a strapped down neck of its victim. However, this mostly resulted in the neck getting crushed rather than cut. To improve upon the device the pair decided to replace the axe with a super sharp blade, with King Louis XVI himself suggesting an angled blade to allow for various neck sizes. In what must have been a pretty sick burn, Dr. Louis named his new killing machine the guillotine to honor Dr. Guillotin, who you might remember hated the death penalty.
The first execution by guillotine took place in 1792, luckily right before the Reign of Terror began in France. With more radical elements taking control in the Assembly, it was decided that France didn't really need a noble class at all, resulting in thousands being rounded up to have their heads lopped off, most notably King Louis XVI and his wife Queen Marie Antoinette. The French people thought the whole thing was great fun and huge crowds would show up to every execution, cheering and jostling for the chance to dip their handkerchiefs in the blood of the accused, followed by parading the severed heads about town. The idea of the guillotine was so popular that people began buying small ones to cut vegetables and toy ones for the kids. Unfortunately, as happens, things began to get out of control once they ran out of nobles. Various political groups began jockeying for power, which of course involved a lot of guillotining of those not deemed radical enough, and then of those deemed too radical. In total around 16,000 people were guillotined over the course of a year.
As a result of all this mayhem the country fell under the control of a dictator named Napoleon Bonaparte, you might have heard of him, who allowed the surviving nobility to return, who were strangely proud of their executed relatives. To show it they took to wearing red scarves, cutting their hair short in the back, and doing dances full of jerking motions similar to a body when the head gets lopped off. This is in turn led to others later dressing the same, though only to be ironic, which is pretty much the start of hipsters. Anyways, though France had six other types of government following the fall of Napoleon, the guillotine remained the primary method of execution for all of them. The last public execution in France by guillotine was in 1939, the last execution was in 1977, and it wasn't finally outlawed until 1981.