Barack Obama has been elected president twice, but his party has now gotten drubbed in the two midterm elections held during his presidency. He will face a Republican Senate and House. Because the Democrats will be able to block Republican initiatives in the Senate with forty votes, and because, if necessary, Obama can exercise a veto, he can prevent the evisceration of the Affordable Care Act and the Dodd-Frank financial reform bill, but he and the Democrats won’t be able to pass any initiatives of their own; and he will have a very difficult time getting his nominations and appointments confirmed. Gridlock? That’s probably too mild a description of what America has in store over the next two years.

Did it have to happen—particularly given that in repudiating the president and the Democrats, voters were reacting to the palsied state of Washington politics? A president’s party rarely does well in midterm elections, and that’s been particularly true in a president’s second term. And the country has still not fully recovered from the Great Recession. Employment is up, but not wages, and that may have hurt the Democrats. But midterm losses don’t have to be as severe as those that the Democrats have suffered under Obama. In 1998, resident Clinton and the Democrats actually added five seats in the House, broke even in the Senate, and won a governorship. Obama himself has to take some blame and his Republican opponents some credit for what happened yesterday.

Here are the key factors that contributed to this year’s Democratic debacle.

The Midterm Factor

In midterm elections, turnout is generally far lower than in presidential years. In 2010 and 2014, some of those groups of voters that had helped Obama and the Democrats win in 2008 and 2012 turned out in disproportionately smaller numbers that those voters who had supported Republicans in 2008 and 2012. Take younger voters. In 2012, voters between 18 and 29 years old made up 19 percent of the electorate and voted for Obama by 60 to 37 percent. Voters from 30 to 44 years old made up 27 percent and backed Obama 52 to 45. That’s almost half the electorate. In the preliminary exit polls yesterday (the exit polls are adjustment to reflect the final results), these voters made up only 32 percent of the electorate. The 18- to 29-year-olds backed Democrats by 55 to 42 percent and the 30- to 44-year-olds backed Democrats by 52 to 46 percent.

Now look at the flipside. Voters 45-to-64 and 65 and over went for Mitt Romney in 2012 and for Republicans this year. They made up 54 percent of the electorate in 2012 but a whopping 67 percent on Tuesday. If the proportions of the vote had been similar to those of presidential years, the Democrats might have had a better chance in the elections. Take the North Carolina race, where Thom Tillis defeated incumbent Democratic Senator Kay Hagan. According to the exit polls, Hagan won 18- to 29-year-olds 54 to 39 percent and 30- to 44-year-olds 56 to 39 percent and lost 45- to 64-year-olds 48 to 50 percent and 65 and over 44 to 54 percent. But the 18- to 44-year-olds only made up 36 percent of the vote. Democrats faced a similar problem with the Hispanic vote, which was important in Florida and Colorado. But turnout wasn’t the only problem the Democrats faced.