The GOP may be in the midst of an identity crisis, but the Democratic Party is also facing a political crisis that could be made a lot worse if it doesn't win the White House in November.

Here's why:

Part of President Obama's legacy is the health of his party. He's had many successes in office — health care reform, climate change regulations, Wall Street reform — but his legacy will also include one huge failure: a diminished Democratic Party.

Every president sees his party lose hundreds of positions — it's the price a party holding the White House pays — but no president has come close to Obama. During Obama's eight years in office, the Democrats have lost more House, Senate, state legislative and governors seats than under any other president.

When Obama took office, there were 60 Democratic senators; now there are 46. The number of House seats held by Democrats has shrunk from 257 to 188.

There are now nine fewer Democratic governors than in 2009. Democrats currently hold fewer elected offices nationwide than at any time since the 1920s.

How did this happen?

1. There are two different electorates in America

There is Presidential Election America, where turnout is diverse. The electorate is younger, browner, more single, more secular — more Democratic. Then there's Midterm Election America, where the electorate is older, whiter, more rural, more church-going — in other words, more Republican. What's great for Republicans and bad for Democrats is that the vast majority of the governorships and state legislative seats are elected in the midterms.

And those positions are the seed corn for a party — they're the farm teams for higher-level offices. Right now the Democrats are at a very low ebb.

This is something President Obama lamented when he campaigned for Democrats in the midterm elections of 2010 and 2014. Republicans manage to turn out their voters every two years, but Democrats, for some reason, only turn their voters out every four. Maybe, Obama mused, because Democrats just don't think midterms are "sexy enough."

2. Bad luck

Democrats had one spectacularly bad piece of luck. The Republicans' Tea Party-fueled surge in 2010 was perfectly timed to coincide with the decennial census, after which new congressional and state legislative district boundaries are drawn by governors and state legislatures. Republicans' huge gains in the 2010 midterms put them in the driver's seat when it came time to draw new congressional districts in 2011. Former Pennsylvania Gov. Ed Rendell remembers what happened when Republicans took over the governor's mansion and the Legislature in his state:

"When I left office in January of 2011," says Rendell, "there were 13 Democratic congressman and six Republican congressman. As a result of redistricting in the 2010 election, that turned around and we now have 13 Republican congressmen and five Democratic congressman."

3. Democrats don't care

It's not only bad timing and gerrymandering that have hollowed out the Democratic Party. Mo Elleithee, a former Democratic National Committee official, says Democrats have never put enough effort and resources into state legislative races. Republicans, on the other hand, make those races a top priority.

4. Too many Democrats live in cities

This is another problem that makes it easier for Republicans to draw congressional and state legislative districts that disadvantage Democrats. Democratic voters are clumped together in urban areas. You could say that for the purposes of winning elections, Democratic voters are just not efficiently distributed.

Its why even in red states like Texas and Utah there are cities that are solidly Democratic — and why lesbian mayors were elected in Houston and Salt Lake City. When Democrats cluster in and around cities, they win local elections, but that doesn't help them win suburban or rural congressional seats.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.