More than 750 people have been diagnosed with measles in the United States this year, the most cases nationwide in more than 20 years. Health officials say that more than 500 of those people had not been vaccinated.

The biggest outbreaks are in New York, where more than 670 people have been diagnosed with measles. In California, just 42 people have come down with the disease this year, in part because of steps the state has taken to curb outbreaks, experts say.

In 2000, measles was declared eliminated in the United States. At the time, enough Americans were vaccinated against measles that officials believed it would be very difficult for the disease to spread here.

But then vaccination rates began to drop as fears of vaccines took root, especially in California. Doctors say that roughly 95% of a community needs to be vaccinated to prevent measles outbreaks. In California, vaccination rates for measles reached a low of 92.3% in 2013.

The following year, someone with measles visited Disneyland over the holidays, sparking an outbreak that rapidly grew across the state. California had become vulnerable.

Measles is one of the most contagious diseases in the world. Whereas someone with ebola is likely to infect two other people, one person with measles is expected to infect between 12 and 18. The only way to prevent an outbreak of measles, scientists say, is to rely on something they call herd immunity.

If enough of the population is vaccinated, a single case of measles won’t be able to spread in a community. The high vaccination rates will protect unvaccinated people too, including babies who are too young to get the measles shot, people who can’t get the measles vaccine for medical reasons and people for whom the vaccine doesn’t work.

But achieving herd immunity for measles requires 95% vaccination rates. In 2014, California had lost it.

In a population with higher vaccination rates, an outbreak would have been more contained -- or prevented altogether.

The Disneyland outbreak ultimately infected 131 Californians and was fueled by low vaccination rates, scientists say.

Within months, California legislators tightened the state’s vaccination laws. They barred parents from opting out of vaccines because of their personal beliefs. Now, parents in California can excuse children from vaccines only if their child has a medical reason not to be vaccinated.

Since the law took effect, California’s measles vaccination rate has begun to climb.

But that isn’t the case in every state. Though the MMR vaccination rate is about 94% nationwide, there are large pockets of people with low immunization rates who are vulnerable to outbreaks across the country. Currently, there are confirmed cases of measles in 23 states.

Measles outbreaks in other states, such as New York, have mushroomed among unvaccinated populations, largely made up of families who chose not to vaccinate for personal beliefs.

California is one of three states that does not allow personal or religious belief exemptions. The other two, Mississippi and West Virginia, have had no measles cases so far this year.

Some states are considering passing legislation like California’s to try to stem future outbreaks. But California’s law hasn’t been a silver bullet.

Though parents are unable to secure personal belief exemptions, many have turned to medical exemptions to excuse their kids from their required shots. In some schools in California, more than 50% of kindergartners still don’t have all of their required shots. Half of California’s 58 counties have vaccination rates below the 95% threshold required for herd immunity.

It seems that some parents have found doctors who will write them suspect medical exemptions from vaccines. Physicians have been accused of writing exemptions because a child has asthma or psoriasis. Though vaccination rates have gone up, so have medical exemption rates.

California legislators are weighing a bill that would force the state to track each medical exemption, in an attempt to tamp down on fraudulent ones.

Public health officials say that the state needs to maintain high vaccination rates because measles has become a major problem in other parts of the world. American travelers are increasingly likely to contract measles abroad and bring it back home, experts say.

Two Northern California outbreaks this year were both traced back to people who had visited the Philippines. L.A.’s outbreak began with someone who took a trip to Vietnam. The outbreaks in New York were linked to travelers who contracted the disease in Israel.

Federal health officials say that the most common countries where Americans have picked up measles this year were Ukraine, Israel and the Philippines.