"Makes me think that chains wear out from dirt and not from lack of lubrication."
John, you make an excellent point. Modern chains are permanently lubricated, with 'O' or 'X' rings holding the lube in the bearing surfaces. The sprocket to chain surfaces are not lubricated, and dirt and grit can wear away both. So the 'dirt' and grease cutting power of WD-40 works well.
Maybe WD-40 can serve to cut through carbon fouling. Could be good for black powder cleaning. Of course I'm just guessing here.
Ron