Blue Democratic donkey cookies and red Republican elephant cookies on a tray at the Red Mug Bake Shop on Nov. 2, 2012, in Superior, Wis. (AP)

With the 2018 midterms months away and the 2020 presidential election cycle approaching rapidly, Democrats are considering how to improve their poor showings in 2014 and 2016. The party has been debating — sometimes heatedly — how to do this. Which voters should they target? How should Democrats target them?

But here’s what’s clear: White voters have been fleeing the Democratic Party, and that’s a big reason Democrats are looking to rebound from back-to-back losses.

Over decades, whites have steadily abandoned the Democratic Party

Whites have slowly but consistently moved away from the Democratic Party. These recent losses are on top of Democrats’ losses among Southern whites during the 1960s and 1970s after Democrats’ support of the Civil Rights Act of 1964 and the Voting Rights Act of 1965.

Bill Clinton won 49 percent of the white two-party vote in 1996. Al Gore won 43 percent in 2000. John F. Kerry won 41 percent in 2004. Barack Obama won a slightly larger share in 2008, but then dropped to only 39 percent in his 2012 reelection bid. Hillary Clinton got the same percentage as Obama.

Obama was able to mask the Democratic Party’s weakness among whites by prompting record-high turnout among African Americans, as well as strong turnout from other Democratic-leaning minority groups. Hillary Clinton was unable to generate the same level of enthusiasm from racial and ethnic minorities.

Here’s how I did my research

My new research helps explain how Democrats got to this point. I utilized survey data from the American National Election Study that spanned 1972 to 2012 and the General Social Survey that spanned 1983 to 2014 to see how the predictors of white vote choice had changed. I found that white voters’ shift toward the Republican Party has been driven by two factors.

The first factor is that growing elite polarization has caused the electorate to “sort” along ideological lines.

On the elite level, Republicans are conservatives and Democrats are liberals. The parties are clearly divided ideologically, and there is no overlap between the two. This is quite different from previous eras, when Southern Democrats and Northern Republicans looked quite different from the rest of their parties.

Voters have an easier time deciding which party best matches their own position when the party positions are highly polarized. As a result, liberals have increasingly become Democrats, and conservatives have become Republicans.

This sorting process has hurt the Democratic Party among whites (especially in the South and Midwest), as there were historically more conservative white Democrats than liberal white Republicans. For Democrats, the increase in support among formerly Republican white liberals has not made up for the loss of white conservatives.

The second factor is that demographic changes have decreased the ratio of whites to nonwhites in the electorate. The electorate was 29 percent nonwhite in 2016. This is up from 11 percent in 1976 and 19 percent in 2000.

This is politically important because the average white voter is more economically conservative and more socially liberal on issues such as abortion, gay rights and so on than the average nonwhite voter. (This varies by education level, as I’ll discuss below.)

As the ratio of nonwhites to whites has increased, an increasing proportion of whites are now “right of center” on economic issues and “left of center” on social issues. The growth of the nonwhite population has pulled the overall median away from the median white citizen’s position — on both social and economic issues.

Taking advantage of these demographic changes, the Democratic Party has courted and won more votes from ethnic and racial minority groups. However, at the same time, in response to these demographic changes, more whites have shifted rightward on economic issues.

I built an index that combines individuals’ positions on a number of survey items and reduces their answers to one summary measure of economic liberalism. I found that 58 percent of whites were to the right of the median in 1972 — but that had become 65 percent in 2016.

As most whites shift rightward, they perceive the Democratic Party to be shifting leftward

I used the American National Election Study data to show that many whites view the Democratic Party as moving further away from their own positions. This is true both when whites are asked to assess the positions of the parties generally and on a variety of specific issues such as government-sponsored health care and the government’s role in providing employment.

My research suggests this combination of political “sorting” and changing white perceptions of the Democratic Party has resulted in an almost eight-point swing in white vote choice. That lines up well with actual vote returns. White votes were split between the two parties about 50-50 in the 1970s — but in elections since 2000, that has become closer to 60-40 in favor of the Republican Party. Democrats might be gaining more votes from Latinos, Asians and other emerging demographic groups, but they are losing whites as a result.

Furthermore, the demographics of the white voters who are likely to support Democrats are different from the white voters who supported the Democratic Party in previous decades.

Most notably, while the Democratic Party is winning a lower percentage of whites overall, a greater proportion of college-educated whites are voting for Democrats. Attitudes on social issues in particular have become stronger predictors of voting behavior in recent elections; economic attitudes have become more important, too, but were already quite a strong predictor to start with.

The Democratic Party is increasingly a coalition of professional-class whites and members of ethnic and racial minority groups. Overall, the Democratic Party has made inroads among socially liberal whites while losing social and economic conservatives.

These changes have altered the Democratic Party’s prospects in presidential elections. While Democrats might be winning more college-educated whites, members of that group often live in states that are already heavily tilted toward Democrats. Whites without college degrees make up a large proportion of voters in many critical swing states in the Upper Midwest — the very states Trump was able to flip from blue to red in 2016.

Thus the Democratic Party is not simply winning a lower proportion of white voters; the whites who are getting more likely to vote for Democrats are less helpful in carrying the electoral college.

The decrease in white support for the Democratic Party is one of the most important trends in U.S. politics. This shift in white voting behavior is the result of changes of the parties’ positions and the country’s demographics.

Joshua N. Zingher is an assistant professor of political science at Old Dominion University whose research focuses on mass political behavior, elections and representation.