The mix of energy sources used to produce electricity is changing—slowly. Coal is still king and is expected to retain that title for decades, giving ground only gradually to renewable fuels, natural gas and nuclear power.

Coal will account for 39% of global net electricity generation next year and 36% in 2040, according to projections by the U.S. Energy Information Administration.

Many...