She grew up in Hungary, daughter of a butcher. She decided she wanted to be a scientist, although she had never met one. She moved to the United States in her 20s, but for decades never found a permanent position, instead clinging to the fringes of academia.

Now Katalin Kariko, 66, known to colleagues as Kati, has emerged as one of the heroes of Covid-19 vaccine development. Her work, with her close collaborator, Dr. Drew Weissman of the University of Pennsylvania, laid the foundation for the stunningly successful vaccines made by Pfizer-BioNTech and Moderna.

On Monday, they were jointly awarded the Nobel Prize for Physiology or Medicine for their research.

For her entire career, Dr. Kariko has focused on messenger RNA, or mRNA — the genetic script that carries DNA instructions to each cell’s protein-making machinery. She was convinced mRNA could be used to instruct cells to make their own medicines, including vaccines.

But for many years her career at the University of Pennsylvania was fragile. She migrated from lab to lab, relying on one senior scientist after another to take her in. She never made more than $60,000 a year.

By all accounts intense and single-minded, Dr. Kariko lives for “the bench” — the spot in the lab where she works. She cares little for fame. “The bench is there, the science is good,” she shrugged in a recent interview. “Who cares?”

Dr. Anthony Fauci, director of the National Institutes of Allergy and infectious Diseases, knows Dr. Kariko’s work. “She was, in a positive sense, kind of obsessed with the concept of messenger RNA,” he said.

Dr. Kariko’s struggles to stay afloat in academia have a familiar ring to scientists. She needed grants to pursue ideas that seemed wild and fanciful. She did not get them, even as more mundane research was rewarded.

“When your idea is against the conventional wisdom that makes sense to the star chamber, it is very hard to break out,” said Dr. David Langer, a neurosurgeon who has worked with Dr. Kariko.

Dr. Kariko’s ideas about mRNA were definitely unorthodox. Increasingly, they also seem to have been prescient.

“It’s going to be transforming,” Dr. Fauci said of mRNA research. “It is already transforming for Covid-19, but also for other vaccines. H.I.V. — people in the field are already excited. Influenza, malaria.”

For Dr. Kariko, most every day was a day in the lab. “You are not going to work — you are going to have fun,” her husband, Bela Francia, manager of an apartment complex, used to tell her as she dashed back to the office on evenings and weekends. He once calculated that her endless workdays meant she was earning about a dollar an hour.

For many scientists, a new discovery is followed by a plan to make money, to form a company and get a patent. But not for Dr. Kariko. “That’s the furthest thing from Kate’s mind,” Dr. Langer said.

She grew up in the small Hungarian town of Kisujszallas. She earned a Ph.D. at the University of Szeged and worked as a postdoctoral fellow at its Biological Research Center.

In 1985, when the university’s research program ran out of money, Dr. Kariko, her husband, and 2-year-old daughter, Susan, moved to Philadelphia for a job as a postdoctoral student at Temple University. Because the Hungarian government only allowed them to take $100 out of the country, she and her husband sewed £900 (roughly $1,246 today) into Susan’s teddy bear. (Susan grew up to be a two-time Olympic gold medal winner in rowing.)

When Dr. Kariko started, it was early days in the mRNA field. Even the most basic tasks were difficult, if not impossible. How do you make RNA molecules in a lab? How do you get mRNA into cells of the body?

In 1989, she landed a job with Dr. Elliot Barnathan, then a cardiologist at the University of Pennsylvania. It was a low-level position, research assistant professor, and never meant to lead to a permanent tenured position. She was supposed to be supported by grant money, but none came in.

She and Dr. Barnathan planned to insert mRNA into cells, inducing them to make new proteins. In one of the first experiments, they hoped to use the strategy to instruct cells to make a protein called the urokinase receptor. If the experiment worked, they would detect the new protein with a radioactive molecule that would be drawn to the receptor.

“Most people laughed at us,” Dr. Barnathan said.

One fateful day, the two scientists hovered over a dot-matrix printer in a narrow room at the end of a long hall. A gamma counter, needed to track the radioactive molecule, was attached to a printer. It began to spew data.

Their detector had found new proteins produced by cells that were never supposed to make them — suggesting that mRNA could be used to direct any cell to make any protein, at will.

“I felt like a god,” Dr. Kariko recalled.

She and Dr. Barnathan were on fire with ideas. Maybe they could use mRNA to improve blood vessels for heart bypass surgery. Perhaps they could even use the procedure to extend the life span of human cells.

Dr. Barnathan, though, soon left the university, accepting a position at a biotech firm, and Dr. Kariko was left without a lab or financial support. She could stay at Penn only if she found another lab to take her on. “They expected I would quit,” she said.

Universities only support low-level Ph.D.s for a limited amount of time, Dr. Langer said: “If they don’t get a grant, they will let them go.” Dr. Kariko “was not a great grant writer,” and at that point “mRNA was more of an idea,” he said.

But Dr. Langer knew Dr. Kariko from his days as a medical resident, when he had worked in Dr. Barnathan’s lab. Dr. Langer urged the head of the neurosurgery department to give Dr. Kariko’s research a chance. “He saved me,” she said.

Dr. Langer thinks it was Dr. Kariko who saved him — from the kind of thinking that dooms so many scientists.

Working with her, he realized that one key to real scientific understanding is to design experiments that always tell you something, even if it is something you don’t want to hear. The crucial data often come from the control, he learned — the part of the experiment that involves a dummy substance for comparison.

“There’s a tendency when scientists are looking at data to try to validate their own idea,” Dr. Langer said. “The best scientists try to prove themselves wrong. Kate’s genius was a willingness to accept failure and keep trying, and her ability to answer questions people were not smart enough to ask.”

Dr. Langer hoped to use mRNA to treat patients who developed blood clots following brain surgery, often resulting in strokes. His idea was to get cells in blood vessels to make nitric oxide, a substance that dilates blood vessels, but has a half-life of milliseconds. Doctors can’t just inject patients with it.

He and Dr. Kariko tried their mRNA on isolated blood vessels used to study strokes. It failed. They trudged through snow in Buffalo, N.Y., to try it in a laboratory with rabbits prone to strokes. Failure again.

And then Dr. Langer left the university, and the department chairman said he was leaving as well. Dr. Kariko again was without a lab and without funds for research.

A meeting at a photocopying machine changed that. Dr. Weissman happened by, and she struck up a conversation. “I said, ‘I am an RNA scientist — I can make anything with mRNA,’” Dr. Kariko recalled.

Dr. Weissman told her he wanted to make a vaccine against H.I.V. “I said, ‘Yeah, yeah, I can do it,’” Dr. Kariko said.

Despite her bravado, her research on mRNA had stalled. She could make mRNA molecules that instructed cells in petri dishes to make the protein of her choice. But the mRNA did not work in living mice.

“Nobody knew why,” Dr. Weissman said. “All we knew was that the mice got sick. Their fur got ruffled, they hunched up, they stopped eating, they stopped running.”

It turned out that the immune system recognizes invading microbes by detecting their mRNA and responding with inflammation. The scientists’ mRNA injections looked to the immune system like an invasion of pathogens.

But with that answer came another puzzle. Every cell in every person’s body makes mRNA, and the immune system turns a blind eye. “Why is the mRNA I made different?” Dr. Kariko wondered.

A control in an experiment finally provided a clue. Dr. Kariko and Dr. Weissman noticed their mRNA caused an immune overreaction. But the control molecules, another form of RNA in the human body — so-called transfer RNA, or tRNA — did not.

A molecule called pseudouridine in tRNA allowed it to evade the immune response. As it turned out, naturally occurring human mRNA also contains the molecule.

Added to the mRNA made by Dr. Kariko and Dr. Weissman, the molecule did the same — and also made the mRNA much more powerful, directing the synthesis of 10 times as much protein in each cell.

The idea that adding pseudouridine to mRNA protected it from the body’s immune system was a basic scientific discovery with a wide range of thrilling applications. It meant that mRNA could be used to alter the functions of cells without prompting an immune system attack.

“We both started writing grants,” Dr. Weissman said. “We didn’t get most of them. People were not interested in mRNA. The people who reviewed the grants said mRNA will not be a good therapeutic, so don’t bother.’”

Leading scientific journals rejected their work. When the research finally was published, in Immunity, it got little attention.

Dr. Weissman and Dr. Kariko then showed they could induce an animal — a monkey — to make a protein they had selected. In this case, they injected monkeys with mRNA for erythropoietin, a protein that stimulates the body to make red blood cells. The animals’ red blood cell counts soared.

The scientists thought the same method could be used to prompt the body to make any protein drug, like insulin or other hormones or some of the new diabetes drugs. Crucially, mRNA also could be used to make vaccines unlike any seen before.

Instead of injecting a piece of a virus into the body, doctors could inject mRNA that would instruct cells to briefly make that part of the virus.

“We talked to pharmaceutical companies and venture capitalists. No one cared,” Dr. Weissman said. “We were screaming a lot, but no one would listen.”

Eventually, though, two biotech companies took notice of the work: Moderna, in the United States, and BioNTech, in Germany. Pfizer partnered with BioNTech, and the two now help fund Dr. Weissman’s lab.

Soon clinical trials of an mRNA flu vaccine were underway, and there were efforts to build new vaccines against cytomegalovirus and the Zika virus, among others. Then came the coronavirus.

Researchers had known for 20 years that the crucial feature of any coronavirus is the spike protein sitting on its surface, which allows the virus to inject itself into human cells. It was a fat target for an mRNA vaccine.

Chinese scientists posted the genetic sequence of the virus ravaging Wuhan in January 2020, and researchers everywhere went to work. BioNTech designed its mRNA vaccine in hours; Moderna designed its in two days.

The idea for both vaccines was to introduce mRNA into the body that would briefly instruct human cells to produce the coronavirus’s spike protein. The immune system would see the protein, recognize it as alien, and learn to attack the coronavirus if it ever appeared in the body.

The vaccines, though, needed a lipid bubble to encase the mRNA and carry it to the cells that it would enter. The vehicle came quickly, based on 25 years of work by multiple scientists, including Pieter Cullis of the University of British Columbia.

Scientists also needed to isolate the virus’s spike protein from the bounty of genetic data provided by Chinese researchers. Dr. Barney Graham, of the National Institutes of Health, and Jason McClellan, of the University of Texas at Austin, solved that problem in short order.

Testing the quickly designed vaccines required a monumental effort by companies and the National Institutes of Health. But Dr. Kariko had no doubts.

On Nov. 8, the first results of the Pfizer-BioNTech study came in, showing that the mRNA vaccine offered powerful immunity to the new virus. Dr. Kariko turned to her husband. “Oh, it works,” she said. “I thought so.”

To celebrate, she ate an entire box of Goobers chocolate-covered peanuts. By herself.

Dr. Weissman celebrated with his family, ordering takeout dinner from an Italian restaurant, “with wine,” he said. Deep down, he was awed.

“My dream was always that we develop something in the lab that helps people,” Dr. Weissman said. “I’ve satisfied my life’s dream.”

Dr. Kariko and Dr. Weissman were vaccinated on Dec. 18 at the University of Pennsylvania. Their inoculations turned into a press event, and as the cameras flashed, she began to feel uncharacteristically overwhelmed.

A senior administrator told the doctors and nurses rolling up their sleeves for shots that the scientists whose research made the vaccine possible were present, and they all clapped. Dr. Kariko wept.

Things could have gone so differently, for the scientists and for the world, Dr. Langer said. “There are probably many people like her who failed,” he said.