I was told wd40 was developed at Edward's air force base for cleaning and dehumidifying connections for airplanes. If moisture was in the connection it would freeze at high altitudes and cause failures....
They're very proud of their history, and rightfully so.
https://www.wd40.com/history/
"In 1953, a fledgling company called Rocket Chemical Company and its staff of three set out to create a line of rust-prevention solvents and degreasers for use in the aerospace industry. Working in a small lab in San Diego, California, it took them 40 attempts to get the water displacing formula worked out. But they must have been really good, because the original secret formula for WD-40® Multi-Use Product -which stands for Water Displacement perfected on the 40th try—is still in use today.
Convair, an aerospace contractor, first used WD-40 Multi-Use Product to protect the outer skin of the Atlas Missile from rust and corrosion. The product actually worked so well that several employees snuck some cans out of the plant to use at home.
A few years following WD-40 Multi-Use Product's first industrial use, Rocket Chemical Company founder Norm Larsen experimented with putting WD-40 Multi-Use Product into aerosol cans, reasoning that consumers might find a use for the product at home as some of the employees had. The product made its first appearance on store shelves in San Diego in 1958."
WD was never patented to avoid having to disclose the recipe and the exact recipe remains a trade secret, but it's not hard to figure out what at least some of the ingredients are by their properties. As a machinist I used it to displace water on milling machine tables. Oil floats on water and any condensation or water used for cleaning chips off tables would cling to the metal under the oil and cause rust to form in the t-ways. WD-40 is about the only thing oil AND water will float on. It obviously has a good amount of paraffin in it, which has higher displacement than water and a greater affinity for metals than water or oil. It also obviously does contain at least a few types of solvent. Paraffin is a decent rust inhibitor, but it isn't a lubricant, and WILL form a "skin" on metal surfaces over time which collects grime so be careful using WD as a general-purpose solvent and lubricant. When I setup machines for new jobs, I would use it to get the water out of chip raceways and t-ways then clean it off with MEK or acetone when everything was dry. Leaving the WD on tables would guarantee the next setup would have problems due to waxy buildup.