It's not cheaper when you factor in the batteries, the need for sophisticated electric grids, etc. China and India continue to build huge amounts of coal power. It's not because they're too stupid to buy the cheaper option.
https://ember-energy.org/latest-insights/the-first-evidence-...
A lot of people simply dont have electricity. They don't have grids. Night comes, it's dark. People are buying solar panels to get electricity directly. Now they can recharge lights during the day.
> China and India continue to build huge amounts of coal power.
One factor here is finance: companies make more money building coal plants. Banks loan the money so they can make money. Solar isn't as lucrative. It's the cheapest source of energy.