Aw come on, Norway has oil and it is small, but was social-democratic long before any oil, and both Denmark and Sweden have built successful welfare safety nets without relying so much on a natural-resources windfall.
In all of the Scandinavian countries the welfare state really didn't start until around the 1960s-1970s.
The government programs have only been possible because of the successful private economy to pay for it, just like in the US.
Although Denmark doesn't have the massive oil wealth that Norway does, there is still some and enough that Denmark is a net oil exporter. And the Danish state gets billions of kroner from oil each year.