We did it because of fracking nat. gas replacing coal due to innovation. Capitalism brings a lot of innovation including advancements in green energy too.
Tesla was able to economically compete and take a huge segment away from the automobile giants through capitalism, forcing them to compete and develop EV cars.
I don't see many socialist countries actually doing much, hell Germany still wanted Russian gas so much someone (wonder who) had to blow up the pipeline!