A gas plant can be ramped up and down quite fast, so they can be used as a so-called "peaker" plant, only producing when there's a shortage of solar/wind power. Coal takes a while to get hot and to cool down, so it's only worth using it if you need a constant stream of energy.
Have you ever had a camp fire/bonfire? It takes a LONG time to get the wood hot enough to burn well.
In contrast your gas stove goes on and off in a moment.
Coal vs gas is the same way.
Natural gas produces about half the CO2 emissions per unit energy as coal. (And presumably less other harmful stuff like radioactive fly ash.)
https://www.eia.gov/tools/faqs/faq.php?id=73&t=11
A gas plant can be ramped up and down quite fast, so they can be used as a so-called "peaker" plant, only producing when there's a shortage of solar/wind power. Coal takes a while to get hot and to cool down, so it's only worth using it if you need a constant stream of energy.