Some claim special formulae. The gun oil biz is a great example of snake oil marketing.
A lot of gun oils - most today - are synthetic. What a lot of consumers don't realize is all synthetics are made from crude oil too. What synthetics really are is molecularly modified petroleum. The molecules are made smaller and more uniform in a complicated refining process so they provide a better lubricating film between two moving parts. Like microscopic ball bearings. Synthetics are also more resistant to heat and dont degrade as quickly as old school oils.
Then there's the non-pretoleum based lubricants. Most of them are highly refined mineral oil with a lot of additives. Others are highly processed plant or seed oils. Products like Froglube or Seal 1 are made from coconut oil. And other ingredients that make them thicker or prevent them from becoming rancid. The non-toxic, edible types borrowed technology from the lubricants developed for food processing equipment.
For quite a while, a lot of the fancy gun oils were actually repackaged turbine oil, which was designed to provide lubrication at high temperatures. It is similar in a lot of ways to transmission fluid. I knew a crusty old career Marine who made his own gun oil from the fluids available from helicopters, jets, armor and other rolling stock. He said, "There ain't no fucking gun stores in Iraq."

He swore by his home brew for all manner of automatic small arms Marines carry.
Here's fun oil-related fact: Rapeseed oil from Canada was originally developed as a lubricant for locomotives. When steam trains went out of fashion, they renamed rapeseed oil "Canola" and sold it as a grocery item. Because nobody would want to fry their chicken in rapeseed oil. RFK is right about seed oils. Humans shouldn't be eating this shit. But Canola is a credible lubricant for anything mechanical.

Or an orgy, as
@Bobster mentioned recently.
The old saying goes... if you visited a stock yard you would swear off meat forever. Same goes for how seed oils are processed. It looks and works just like an oil refinery. I worked on a project in a plant where they hydrogenate vegetable oils. The caustics they use to facilitate this process ate holes thru the soles of my shoes.