Welfare states generally developed as countries became wealthier overall. As they did, there came to be more pressure on the government to ensure that various sectors of society were not being abused. This is how welfare states generally started, with government intervention into things like working conditions and wages as countries became more affluent.
In many cases, the welfare state became more pronounced after a crisis. This was the case in the creation of the US welfare state, which stemmed from the Great Depression, and the British welfare state, which came out of WWII. In both cases, people came to feel that the government should play a role in alleviating the economic pain caused by the crises. They had gotten used to the idea of being somewhat well-off and they had gotten used to the idea that the government should help keep them that way. When crises arose, they started to put more pressure on the government to create a more extensive welfare state.
Overall, then, welfare states seem to arise as countries become richer. Crises can then increase the scope of the welfare state as the populace demands that government help to shield them from the economic pain caused by those events.