In New York, emergency rooms are overcrowded and refrigerated trucks house dead bodies in the street. In California, thousands of hospital beds are sitting empty and the state recently lent 500 ventilators to harder-hit states.

Despite having the nation’s largest population, frequent travel with China and the first confirmed case of community spread in the country, California has only 15,865 cases of Covid-19 and 374 deaths as of Tuesday, compared with 138,863 cases and 5,489 deaths in New York state, according to their public health departments.

Experts attribute the relatively low numbers to California taking some of the earliest and most aggressive social-distancing measures in the country, as well as to its cities having less dense populations than New York’s. But they caution that the state is still far from its projected peak in cases, which state officials currently put at mid-May, and that, if the situation takes a turn for the worse, the death toll in a state with 40 million people could be astronomical.

“I hope and pray that doesn’t happen,” Dr. Grant Colfax, the director of San Francisco’s health department, said of a major outbreak. “It’s certainly still plausible.”

The number of people with coronavirus being treated in intensive care units across California hit 1,108 Tuesday, more than five times the number on March 27, when the California Department of Public Health began reporting the numbers.

But despite that growth, the trends have been improving.

Researchers at the University of Washington’s Institute for Health Metrics and Evaluation are currently projecting 1,783 people will die from the coronavirus in California by early August, compared with an initial projection of 6,100 made March 26, said Dr. Ali Mokdad, an epidemiologist at the school. That figure, which assumes social distancing measures will remain in place through May, could fall even further.

By contrast, New York is projected to see 15,618 deaths in the same period, a number that has ticked upward in recent days, according to Dr. Mokdad.

After amassing more than 10,000 ventilators over the past few weeks in preparation for a surge, Gov. Gavin Newsom said Tuesday that he would lend up to 500 to other states. California has also launched plans in the past few weeks to add tens of thousands of new hospital beds and recruit additional health-care workers, many of them recently retired.

The most resilient metro region in California may be the San Francisco Bay Area, where six counties issued the nation’s first stay-at-home orders to a large population on March 16. Those six counties had 3,583 confirmed cases and 101 deaths, as of Tuesday, according to Johns Hopkins University data.

Dr. Robert Wachter, chair of the department of medicine at the University of California, San Francisco, said technology companies played a large role in reducing social contact in the region and setting a take-it-serious tone.

By the end of the first week of March, Facebook, Google, Twitter, Microsoft and Salesforce were among those to institute work-from-home policies for most of their employees. Many tech companies have continued paying contract service workers such as janitors and cooks while they stayed home.

“Nobody feels like we are out of the woods, but unless something pretty big changes in the next couple of weeks then, yes, we have flattened the curve and we are likely to stay on the much more benign side of this than what you are seeing in other places,” Dr. Wachter said.