The U.S. is heading into its third Covid-19 Thanksgiving in better shape than the last two, but holiday gatherings will provide a test of whether the nation can avoid another major winter surge, epidemiologists and virus experts say.

Thanksgiving once again comes at a precarious time, as new subvariants take over and the return of cold weather brings people back indoors, often in family gatherings where the virus can easily spread. The holiday last year coincided with the arrival of an early version of the Omicron variant that kicked off an explosive rise in cases and the second-deadliest Covid-19 wave. Only the prior winter, when vaccination efforts were just beginning, saw a higher peak in deaths.

This time around, some virus experts say the lack of a fresh surge triggered by newly ascendant Omicron subvariants is a hopeful sign that built-up immune protection from vaccines and prior infections is helping.

“We may have had an immunity wall built against Omicron,” said Dr. Eric Topol, director of the Scripps Research Translational Institute in La Jolla, Calif.

Infections remain common, including among vaccinated people and those who already had Covid-19. Travel and large holiday gatherings are likely to push infection numbers higher, epidemiologists said. But vaccines and exposure from prior infections help the immune system reduce the chances for hospitalization and death.

“We’re hoping that a combination of people who’ve been infected and boosted and vaccinated, or people who’ve been vaccinated and boosted and not infected, that there’s enough community protection that we’re not going to see a repeat of what we saw last year at this time,” said Dr. Anthony Fauci, the government’s top infectious-disease official, at a White House briefing Tuesday.

All of the subvariants in the U.S. are currently related to Omicron. Two offshoots called BQ.1 and BQ.1.1 collectively represented about 50% of cases by the week ended Nov. 19, according to estimates from the Centers for Disease Control and Prevention.

These subvariants are related to BA.5, the version that drove a summertime surge this year and represents roughly a quarter of cases, the CDC estimated. A mix of other subvariants makes up the remainder.

By Tuesday the seven-day average for hospitalized Covid-19 patients was around 22,200, and largely flat for the past month, federal data show. This remains below levels above 39,000 reached in July when BA.5 was dominant, and up from an April trough around 10,000. A year ago the seven-day average topped 45,000 hospitalized patients, and two years ago the average was about 78,000.

Epidemiologists cautioned that trends can shift quickly, and there is evidence of pressure from rising hospitalizations in places such as California and New Mexico. Los Angeles County, the nation’s most populous, said last week it was strongly recommending steps such as indoor mask wearing and testing before public gatherings to cut down on transmission.

Nationally, virus levels measured in wastewater—a clue used to track the spreading virus—have also been trending up in western states, according to Biobot Analytics, which tracks the sewage data. The numbers through mid-November show flatter trends in the Northeast and South and a slight increase in the Midwest. Nationally, wastewater readings remain well below the summertime BA.5-driven peak.

The nation averaged about 317 Covid-19 deaths a day in the week ended Nov. 16, CDC data show, the lowest level in five months. Case data have become a less reliable way to track the spreading virus because of at-home testing that isn’t reported to public-health departments.

SHARE YOUR THOUGHTS

What are Covid numbers like in your area? Join the conversation below.

The Biden administration is stepping up efforts to get more booster shots into arms as winter approaches. Data show booster demand has been sluggish.

“I am really worried that the uptake in boosters among the elderly is not where it needs to be,” said Dr. Jennifer Nuzzo, who directs the pandemic center at Brown University School of Public Health.

A fresh Covid-19 surge could put significant pressure on hospitals, which are already grappling with early and active seasons for RSV and influenza viruses. Meantime, colder weather and the holidays are coming soon.

“People are going to be indoors in crowded situations with less good ventilation,” said Dr. Helen Boucher, dean of Tufts University School of Medicine in Boston.

Write to Jon Kamp at Jon.Kamp@wsj.com