The origin of WD40 = the planes stored in central USA, desert, suffered from condensation which caused corrosion. Airplane owners asked a well known scientific research company to make a cheap product to repell said condensation. Much trial and error before : WATER DISPERSANT #40 was developed. Based on parafin it was cheap.
It is not a lubricant or anti-sieze agent.