With their resounding victories, how did the Democrats get it right, and where did the Republicans go so wrong?