Concord University in West Virginia and Clemson University in South Carolina were both founded shortly after the Civil War. During the 20th century, each grew rapidly. Now, the two public universities that sit just 300 miles apart face very different circumstances.

Clemson, a large research university, enrolled its largest-ever freshman class in 2017 and in December broke ground on an $87 million building for the college of business.

Concord, a midsize liberal-arts school, has seen its freshman enrollment fall 19% in five years. It has burned through all $12 million in its reserves and can’t afford to tear down two mostly empty dormitories.

The diverging fortunes help explain how U.S. higher education is shifting. For generations, a swelling population of college-age students, rising enrollment rates and generous student loans helped all schools, even mediocre ones, to flourish. Those days are ending.

According to an analysis of 20 years of freshman-enrollment data at 1,040 of the 1,052 schools listed in The Wall Street Journal/Times Higher Education ranking, U.S. not-for-profit colleges and universities are segregating into winners and losers—with winners growing and expanding and losers seeing the first signs of a death spiral.