I have limited knowledge on this, but one time when helping to renovate an old church, the woman who owned it said that it had once happened to her with a sawdust bag.
I did some research after, since it's a fascinating subject, and the reason that it likely happened with the sawdust is that the bag was tied, which allowed small amounts of methane (and heat) to build up.
If better safe that sorry, making sure the compost pile is aerated via flipping it seems to be the most logical thing to do. You'd release some of the stored heat + any built up gas. To combust, it needs like 80'c+(?) + a waft of air for there to be even a chance of a fire. If you have a temperature gauge to check your pile, check it daily and just make sure it's not getting to high over 60'c. There is a double reasoning for this anyways since at 70'c+ you'd start to pasteurize your compost microbes which wouldn't be good either.
"Our ability to change the face of the earth increases at a faster rate than our ability to foresee the consequences of that change"
- L.Charles Birch
Yes there is an inherent risk of a compost pile spontaneously combusting, I've seen it happen when the heap was not put together correctly.
contrary to what would seem impossible, even a properly wetted heap can catch on fire.
What happens is the core reaches very high temperatures because too much fresh green material was piled without any dry, brown material, this creates the same situation as if you cut a lawn and bagged the fresh grass clippings and tied off the bag.
The internal temps can reach above 190 degrees in such a situation and at that point there is enough heat to ignite the dry material surrounding the heating core.
When such a situation occurs, it is very similar to a nuclear reactor melt down, the best way to avoid it is to monitor the core temps and preform a turning if the temps indicates an abnormal heating is occurring.
I once had a heap that was tended by a neighbor while I was away at a conference, he put all the grass clippings in the center and then covered them with the outside of the heap.
He did not add any water, when he was finished. I returned and checked the temp of my heaps, the one he had made the addition to had a core temp of 210 degrees, I forked the heap open and steam rose from the near combusting core.
I spread this heap out to avert a serious incident, it took the core a full day to cool so I could rebuild the heap. This heap did produce some of the best, nutrient dense compost when compared with the other four heaps I had going at the time.