In 2016, my wife Alison and I decided to move our family of six from the tundra of Minnesota to the tropics of Puerto Rico. We wanted to give our kids the chance to experience a different way of life. We said it would be good for them to learn a second language. We believed we were making this move for their sake.

Then one afternoon last September, just three weeks into our Puerto Rican adventure, I found myself in a traffic jam. In a rainforest. During a blackout—Puerto Rico’s first island-wide blackout in 39 years.

I was starting to have some doubts.

I wondered: Do I have enough gas to get home? Is my family safe? What exactly could cause a landmass the size of Connecticut to suddenly lose power from coast to coast? Meanwhile, Alison was holed up half an island away in our not-yet-furnished house with our four kids, ranging in age from 18 months to nine years, surrounded by strangers whose language she didn’t speak.

As I inched forward, I thought about the mixed reviews we’d received from friends and family about our decision to embark on this one-year lifestyle experiment. Some thought it was “really cool.” Others thought it was a bit odd. And a third category of people—mostly fellow parents—tried to mask their outrage while squeezing out a “hmm” through tightly pursed lips. On my drive home that afternoon, all of these implied and imagined criticisms snowballed into one disturbing question: Had our move robbed our kids of the stability they need to become well-adjusted adults?

It’s clear that young people need some measure of stability in their lives. A few months before we moved, researchers in Denmark published a study (pdf) showing that relocation increases a child’s risk of attempted suicide, drug abuse, and violent criminality—the hat trick of parental nightmares. Relocation posed the greatest risks for adolescents who moved more than once in a single year between the ages of 12 and 14. It didn’t matter whether the family was rich or poor, black or white. This was not exactly the affirmation I was looking for.

The study made me question our motives for moving. It’s no secret that my wife and I love to travel. We have also been known to enjoy some sun and sand. What if “we’re doing this for the kids” was just an excuse we were using to rationalize our own selfish desires?

Thankfully, it turns out there is an important caveat to the study. The authors point out that the design of such a study cannot rule out other factors that might cause these terrifying outcomes. There are a number of disruptive things that might be happening in a kid’s life to explain why they would move homes twice in one year, such as the death of a parent, custody battles, foster homes, behavioral problems, and bullying. So is moving the problem, or is it the reason why they moved?

What’s more, there’s also strong reason to believe that children who learn to deal with some adversity—but not too much—actually grow up to become more resilient adults than kids who grow up with no adversity at all. The controversial child psychologist Bruno Bettelheim offered a surprisingly prescient theory about why this may be the case back in the 1970s. In his book The Uses of Enchantment Bettelheim argued that the original forms of beloved fairy tales—the non G-rated versions where Cinderella’s sisters get their eyes plucked out by birds after sawing off their own toes; where Little Red Riding Hood and granny are swallowed whole by the wolf; and where scenes of rape and attempted cannibalism are key plot points in Sleeping Beauty—played an important role in children’s development. These gruesome stories, according to Bettelheim, allowed kids to begin working through the emotional complexities and darker realities of human existence while still sitting on the safe and stable foundation of mommy or daddy’s lap.

Although I have yet to read the uncut version of Hansel and Gretel to my toddlers, Bettelheim might have been on to something. Experiencing a little stress and adversity, in the proper dosage, can have what psychologists call a “steeling” effect on kids: It’s like exposing your kids to chicken pox while they’re still young. A small dose of adversity builds up a lasting psychological immunity that carries over to later challenges. For example, studies show that early exposure to stress blunts a child’s physiological stress response, so that life’s later struggles literally do not feel as disturbing. Moderate childhood adversity may also develop creative coping skills. And, importantly, kids who learn to overcome obstacles in childhood grow up understanding that they don’t need to be in an ideal environment in order to thrive.

When I finally arrived home that evening, I walked into a dark yet lively house. With our toddler strapped happily to her back, Alison was packing a cooler with soon-to-be-rotten milk, cheese, and meat to bring over to a generous neighbor’s generator-powered refrigerator. Many other new neighbors had stopped by to make sure we were okay. Meanwhile, the older boys had discovered they could use the light from the fading laptop screen to play a card game, and were now basking gleefully in the soft glow of their ingenuity.

One major issue still remained: The heat. Moist, tropical heat that made the air in our bedrooms so thick that my Minnesota-born kids swore they could see it. Alison and I exchanged a look that said, It’s going to be a long night. Then we told them to drag the mattresses off the beds and out onto the screened-in terrace, where we would commence a fun, old-fashioned family campout. On the surface of the sun.

Lying next to each other on the patchwork of mattresses, listening to the singing coqui frogs, we began to forget about the oppressive humidity. As my family drifted off to sleep, I thought again about what it means to give our kids “stability.” Is stability defined by a static home address in an unchanging zip code, with consistently high quality schools and predictably low crime rates? Maybe. But there is another kind of stability that might be even more important.

Earlier that summer, I had interviewed a man named Byron Egeland, who has spent the last 50 years as the lead researcher on the Minnesota Longitudinal Study of Risk and Adaptation. The Minnesota Study is generally regarded as the most comprehensive study ever conducted on child development. After half a century of continuous measurement and exhaustive analysis, the one and only thing Egeland would conclude without hesitation or qualification is this: “Nothing is more important in children’s development than how they are treated by their parents, beginning in the early years of life.”

The most important stability you can give your kids, in the end, has to do with your own parenting—which can remain steady even when life does not. This stability comes not from the continuity of the address we give our kids, but from the strength of the relationships we build with them. Out on the porch, I felt confident that our kids were learning something valuable: No matter how dark this unpredictable world may get, they can always count on family to help them find their way.