If you compare Norway to other countries, you should always keep in mind that Norway is just blessed with energy. They have more hydropower than they consume, so electrifying everything just makes sense, even if you ignore consequences for climate and environment. They also have their own oil, and electrification will also allow them to sell more of it abroad or keep in the ground for future generations.

However, it also helps that they are good at long term planning.

Also, outside of the zone of influence of an imperialist authoritarian power which would prevent them from handling the exploitation of their resources for the benefit of their nation instead of the profit of foreign oligarchs. See Petro-Canada privatization.