It doesn't happen often, considering the number of rags soaked with various oil based products, lying about in shops around the world, but it does happen. I had a near catastrophe with a similar set of conditions many years ago. Mine actually did catch fire, fortunately it was laying on the extension wind of the table saw and only scorched the paint. I'm reminded of this event each time I place something on the table saw, which is often used as a catch all for tools, rags and assorted items around the shop.
Spontaneous ignition needs air to work. There's only two ways to prevent it from happening. Spread out the rags (even common cooking oil or furniture polish can catch fire) so they can dry and displace any heat build up or keep air from getting to them.
The best way is to store them in a metal container with a metal lid. They have specific "rag containers" designed just for this, or you can use what I do, which is an old style metal diaper bin. My metal diaper bin has a foot peddle operated lid and used to have pretty flowers printed on the outside. I got it at a yard sale for 2 bucks many years ago. I painted it blood red several years ago after getting teased by a buddy about the cute flowers, with "Oily Rags Only" hand lettered on the lid.
If the rags build up heat, the oxygen inside the container is consumed in the process (a chemical reaction between the rag fibers, the oil and the air) so combustion can't take place. Even if it did catch on fire, the metal container would keep the fire well confined, where a quick blast from a fire extinguisher, will remedy the problem in seconds.
It only makes sense not to store the rag container near the pile of saw dust under the table saw or other tool that produces lots of dust.
I'm glad you got lucky Keith. Even dried out rags, if left in a bundle, can still develop this chemical reaction. It needs air to catch. Remove the air or prevent the heat build up by laying each out flat, on something that will not burn.