Keynes - and others who later elaborated on his work, like Hyman Minsky - taught us that although markets are usually self-correcting, they occasionally enter destructive feedback loops in which a shock to, say, the financial system scares business and consumers so badly that they hoard money, which worsens the damage to the system, which further persuades other economic players to hoard, and so on and so forth.
In that situation, the role of the government is to break the cycle. Because businesses and consumers have stopped spending, the government breaks the cycle by spending.
From The dangers of being wrong on Keynes - The Washington Post
Keynes in a nutshell.