Winemaking evolved from the natural fermenting process, which was discovered in nature. Brewing beer was a step further, but it took an entirely new process to produce distilled spirits. In other words, it took a still. And that was developed by Persian alchemist Abu Musa Jabir ibn Hayyan in the 8th century, during the Islamic Golden Age. Jabir rose to the position of alchemist to the caliph, and his writings on chemistry became famous. Among other accomplishments, he coined the word "alkali," and invented the alembic on order to make spirits.
An alembic is a liquid-filled container placed over a heat source. Connected by a tube to another vessel, it allows vapors from the heated substance to pass through the tube, condense along it, and drip into the other container. That condensation, which is the essence of the distilled material, became known as the “spirit.” Since alcohol has a lower boiling point than water, heating wine in an alembic still causes alcohol to evaporate first, separating it from the water. Jabir made his still of glass or pottery, while later iterations were made of copper.
Jabir’s discovery was the key to producing higher-proof liquor. But he didn’t become a bartender extraordinaire. Instead he noted that distilling wine could create a flammable vapor, which he called “of little use but of great importance to science.”
The spirits were used as fuel and an antiseptic, but a later alchemist and physician used it for medicinal purposes. Read about him, as well as Jabir and the history of distilled alcohol at Atlas Obscura.