She lives in a French town near St.-Tropez that she calls “paradise,” where she and her young son have taken refuge from the war back home in Ukraine. But when Liudmyla Gurenchuk and her son needed to see doctors this fall, they made the 1,300-mile trek back to Kyiv, leaving the picturesque tranquillity of the off-season Riviera for a city that is regularly struck with drones and missiles.

Why take the risk? According to her and other Ukrainian refugees it’s simple: They say the opportunity to receive treatment that can be more affordable and efficient than in many European countries outweighs the dangers of returning home.

“Medicine is just better in Ukraine,” said Ms. Gurenchuk, 39, as she waited to get her thyroid checked at an ultrasound center. “It’s cheaper, it’s faster” and the doctors are more attentive, she said. “That’s why I come every time I can.”

They are part of a wave of refugees — more than two million — who have traveled back and forth between Ukraine and their temporary homes in other European countries to visit relatives, obtain official documents or check on their property. Trains crossing into Ukraine are often packed with families returning for the school holidays, in many cases to visit the husbands and fathers left behind since the government barred most men from leaving during the war.

Historians and sociologists say the scale of these trips is unusual in recent history, owing in good part to the geography of the conflict in Ukraine, where vast swaths of territory remain relatively safe and are accessible from the rest of mainland Europe. The brief returns, those experts add, show that Ukrainian refugees are adapting to the war as it drags on, trying to strike a balance between staying in safer lands abroad and reconnecting with their past lives at home.

Ioulia Shukan, a sociologist at Paris Nanterre University who studies the social impact of the war in Ukraine, said it was a question of “rebuilding a relationship with your homeland without being completely resettled.” She said that medical appointments, a fixture of everyday life, contributed to restoring “a semblance of normality” even if they required an extensive and potentially dangerous journey.

It’s “a bit about reclaiming your past life,” Ms. Shukan said.

Nearly 40 percent of the 5.8 million Ukrainian refugees living in other European countries have returned home at least once, according to the U.N. survey — a figure that Thomas Chopard, a historian at the Paris-based School for Advanced Studies in the Social Sciences, said was significantly higher than during previous European conflicts, such as World War II.

“Back then, there were very few returns,” Mr. Chopard said, because in most cases that would have meant going back to a territory in the throes of fighting or under occupation.

By contrast, 80 percent of Ukraine’s territory is currently free of Russian forces, and while Ukrainian troops continue to battle hard in the south and east, several areas in the west have been spared the fighting for the most part.

Ms. Gurenchuk acknowledged that, unlike with many other refugees, European host countries had granted Ukrainians “privileges” such as work permits and freedom of movement, making it easier for them to come and go. “This war is different,” she said.

The main motivation for people to return home is to visit relatives. But few expected that another top reason would be to see their doctors.

On her most recent trip home, Ms. Gurenchuk dashed from a modern ultrasound center, to the cramped apartment of a folk healer and next to the colorless corridors of a public hospital, where a pediatrician examined her 7-year-old son, Davyd.

Many refugees said that their trips home had been prompted by frustration with health systems in Europe that they see as deficient. That has been particularly true in Britain, where there have been news reports of refugees’ dissatisfaction with the crisis-hit National Health Service.

Maiia Habruk, a 31-year-old media producer, was living in London when she developed a severe sore throat. She said that she had waited two weeks to see a British doctor, who prescribed mild pain relief. Back in her hometown, Dnipro, in central-eastern Ukraine, a doctor identified an infected wisdom tooth as having caused the soreness and arranged for its immediate removal.

“It took me five days — go to Dnipro, visit the doctor, come back to London — versus two weeks in Britain,” Ms. Habruk said. “That was worth the trip.”

Andriy Buglak, an orthopedic surgeon in Kyiv, said that he had been surprised by the returns at first but that he had grown used to them, hearing “the same stories from Scandinavia to Spain” of patients struggling with foreign health care systems. One of his patients recently traveled from Italy to get nothing more than a cortisone injection in the hip.

“All that difficult way just to see me,” Dr. Buglak said.

Refugees cite the language barrier and price as other reasons for seeking treatment back home.

Most health care in Ukraine, as it is in countries like Britain and France, is free in the public system. But treatment that is not covered in some countries, such as dental work or more specialized care, is far cheaper in Ukraine.

When the war broke out, Ms. Gurenchuk, a single mother, fled Kyiv and found refuge in Cogolin, a small town outside St.-Tropez, where she has been hosted by a local couple. She works as a cashier in an upscale seaside resort, and Davyd goes to French summer camps.

“It’s a paradise,” she said in an interview on her sun-drenched terrace in Cogolin.

But it isn’t home. And she still feels the need to return to Kyiv for medical appointments, which she has done twice this year. “I like to make sure I’m healthy,” she said.

As with many of her fellow refugees, Ms. Gurenchuk’s trips have been about more than just health care.

She has also used the visits to see relatives, spend time in her favorite beauty parlors and stroll with Davyd through an amusement park where she spent countless hours as a girl. It was also a comfort to visit the same type of folk healers that she would consult in her youth.

As far as the medical appointments are concerned, a friendly face — such as a familiar pediatrician — is an important benefit.

As they entered the doctor’s office, Davyd’s pediatrician asked him, “Do you recognize me?”

“Yes,” Davyd replied, bringing a smile to his mother’s face.

Mr. Chopard, the historian, said that the trips home also helped refugees maintain hope of a final return, which Ukraine will need if it is to rebuild. Refugees often see themselves as permanent exiles, he noted, but the U.N. survey showed that more than three-quarters of Ukrainians planned to go back.

Ms. Gurenchuk said that she would return to live in Ukraine only when the war was over. But after a week in Kyiv, Davyd seemed enthusiastic about coming back for good.

On the way back from the pediatrician, as night fell, he and his mother passed the apartment where they lived before the war.

“I want to live here!” Davyd said.

Daria Mitiuk contributed reporting from Kyiv.