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.