WD-40 stands for Water Displacement – 40th Attempt. It was originally designed for preventing corrosion by displacing the water that causes it. It was first used to protect missiles from corrosion and became commercially available in 1958.
WD-40’s ingredients are a secret. The makers avoided revealing its ingredients by not filing for a patent, but it is known to consist of oil suspended in a volatile hydrocarbon. When WD-40 is sprayed, the suspended oil can get into crevices where the hydrocarbon evaporates, leaving behind the oil lubricant. Every surface has some degree of imperfection at the molecular level. The long hydrocarbon chains in oils and grease serve to provide a layer between the two surfaces and help them move over each other easily. WD-40 was not originally designed as a lubricant so it is actually not the best lubricant to use on a fast moving mechanical part like a bicycle chain.
Connor Skates, Science Museum