how does coal energy work