Basically just the title. I saw another cool video of some present-day air-to-air refueling and thought "wow, that's super cool, that must have been really difficult to figure out."
So, how did this go from idea to reality?
The Wikipedia page for aerial refueling egregiously glosses over the Russian roots of aerial refueling in World War I, specifically the first known military proposal for aerial refueling somewhere around 1916 to its first end-to-end demo in 1923, which is what this post will cover. It's a cool story.
A 21-year old Russian pilot named Alexander de Seversky had been shot down in 1915 and had his leg amputated. He was deemed unfit for duty but wanted to fly and secretly practiced and modified aircraft to suit his leg. In May 1916, he snuck into an aerial exhibition for Russian military officers and showed a "thrilling display of aerobatics", after which he was arrested for insubordination. But reports of his feats reached Tsar Nicholas II, who responded with an awesome note: "Read. Admire. Let Fly. Nikolai." He was returned to pilot duty in July 1916 and became somewhat of a folk hero.
In September, he was reassigned to Revel. Due to the icy conditions in the Baltic, flights were few and short, and German and Russian ships retreated to await the spring thaw. Seversky had a lot of time on his hands and became something of an amateur inventor - he created innovations that made it easier for one-legged pilots, created a droppable buoy to allow pilots to mark U-boats in the water, developed ice/snow skis for planes, and created an automated bombsight that he would later sell to the US for a huge amount of money.
He also devised a method of refueling M-9 bombers in the air, which allowed them to greatly extend their range, an important consideration since Russian forces had been pushed back within their own territory in 1915 and now could not reach strategic bombing targets in places like modern-day Lithuania.
His aerial refueling method was successfully demonstrated to the Russian Navy in probably late 1916, but for reasons that are unclear (I'm guessing safety and conservatism), the navy declined to pursue the project.
In 1918, Seversky effectively migrated to the US by receiving a posting as the deputy naval attache for aviation in the US. Due to the Russian Revolution, he expected to bide his time until he could return home, but it ended up being a one-way trip and he lived in the US until his death in 1974.
After the end of WWI, he stayed in the US and started working with aviation companies. He was known to be a very experienced aviator and engineer/inventor, and was befriended by Brigadier General Billy Mitchell, who specifically was interested in learning about aerial bombings of naval ships, which Seversky was more experienced in than probably any American at the time.
Seversky told Mitchell about his aerial refueling invention and his bombsight, and Mitchell got Seversky hired as an engineering consultant. He encouraged Seversky to patent aerial refueling out of his own pocket, and Seversky filed (and later received) the first such patent in 1921. By 1922-23, his inflight refueling system was successfully tested by the Equipment Branch, and on June 27, 1923, two DH-4 biplanes in San Diego did the first end-to-end practical demonstration of aerial refueling. By August, a 3,293-mile nonstop flight was demonstrated using the system.
Unfortunately for Seversky, it took until much later - 1948 - for the US to fully integrate aerial refueling into their program by establishing the Air Refueling Squadrons, by which time his original patent had expired. A lot of innovation around safety and reliability by many people occurred within that period, but it seems undisputed that this was all started by the wacky ideas of a 22-year-old one-legged Russian pilot during WWI.
In terms of how difficult it was to figure out? Honestly I don't think that difficult from an engineering perspective for the first iterations. They sound like they were essentially a special hand-operated hose, with a few purpose-designed valves and receptacles. The first systems were definitely dangerous and prone to spew fuel on the receiving aircraft or even burst into flames. The innovations that came later were impressive feats of engineering, but the original design and implementation of that first system was done by at most a handful of people.
My source for this is the first 60 pages of the 349-page biography, "Alexander P. de Seversky and the Quest for Air Power" by James K. Libbey (2013), a super interesting biography of Seversky, who went on to be a very influential person in US Cold War air strategy and generally a very interesting character. Highly recommended reading.