The divergent outcomes in the House and Senate — a Democratic takeover in one chamber, and Republican gains in the other — exposed an ever-deepening gulf separating rural communities from America’s cities and suburbs.

Democratic gains in the House came in densely populated, educated and diverse enclaves around the country, around major liberal cities like New York and Philadelphia and also red-state population centers like Houston and Oklahoma City. The Republican Party’s traditional base in these districts collapsed, with college-educated white voters joining with growing minority communities to repudiate President Trump and his party.

Republican victories in the Senate came mainly in the conservative strongholds where Mr. Trump’s popularity has remained steady or grown since 2016. With rural voters moving rightward and the national Democratic Party moving left, Senate Democrats like Claire McCaskill of Missouri and Joe Donnelly of Indiana found it impossible to reassemble the political coalitions that elected them in the past.

As a long-term proposition, Democrats may be getting the better end of the bargain: They are winning over voters in growing communities that look more like the country as a whole, while Republicans are increasingly reliant on an aging population of conservative whites to hold up their electoral map. And for now, the Democrats’ eclectic coalition of white moderates, young liberals and African-American, Latino and Asian-American voters was more than enough to seize the House.