Photography by Masood Hussain / Getty

The rug had been in Pruszcz Gdański for more than a month. I’d been checking up on it daily, via the shipping company’s website, but nothing was changing. Status: Originating post is preparing to dispatch this mail piece. An insomniac night of online reconnaissance indicated that the rug’s situation was a common one, since apparently many items traveling through this particular town in northern Poland are packed into large shipping containers before being loaded onto a boat. According to one forum post, “The container may just sit until it’s full.”

I was in no particular rush to have this rug—I knew that as surely as I knew what the tracking status would be before I checked it each day. Still, I checked, and checked, and checked again. The rug was for our soon-to-be baby’s room, and I was engaging in a common compulsion of pregnant people, who wait for more than package deliveries: We wait for our bodies to be our own again, for the trauma of labor to be in the past, to meet our kids, and to meet ourselves as parents. There is a word for what I was doing: nesting.

The word seemed to mean different things to different people. “It’s physical,” said the teacher of a birthing class I attended: When you’re vacuuming or scrubbing the floor, she observed, you’re engaging in activities that could help get your baby in the right position. My mom insisted that it was purely practical, “like how birds make nests.” Meanwhile, in line at Trader Joe’s, where I received a lot of unsolicited pregnancy advice, a woman told me that my purchase of cleaning supplies was spiritual—I was readying my home’s feng shui for a baby.

I didn’t relate to much of this: Online shopping requires no particular body positioning, ordering a rug from a Polish weaver when I could easily buy a rug in person was not at all practical, and I don’t know a thing about feng shui. But as all three of these people knew from experience, nesting is a real phenomenon—an anticipatory, energetic state of being typical during pregnancy, one that’s distinct from the more universal desire to keep one’s living space tidy and comfortable.

Some pregnant people never feel compelled to nest, but the ones who do are operating on instinct, according to Lauren Sosenko, a clinical psychologist who specializes in perinatal mental health. “The instinct to create a safe space—which is what nesting is—relates to anxiety, the threats and dangers that exist in the world and in our homes,” Sosenko told me.

While nesting, some people buy baby clothes or build nursery furniture. Others clean their bathrooms or organize their spice racks. The activities might have little to do with welcoming a newborn, but according to Sosenko, preparing for a baby isn’t actually the primary function of nesting—it’s a perfectly normal outlet for the stress of impending parenthood. “When nesting serves its purpose,” she said, “it can help mitigate our anxiety.” The idea, according to a 2013 study in the journal Evolution and Human Behavior, is that nesting is a means of “controlling the physical environment.” In Sosenko’s words, nesting parents have “a need to feel like they are preparing and creating a safe space.” Even if a certain behavior doesn’t truly alter a baby’s environment—as might be the case with organizing the spice rack—it can bring a sense of control over the environment that eases anxiety.

If it doesn’t, that might be an indicator of something deeper going on. Sosenko told me that while working with clients, she takes note of “when nesting crosses the threshold of normative behavior and [their] anxiety is not being satiated”; to her, that’s “a key indicator of the pregnant woman’s emotional state and predisposition to postpartum depression.” (While research on nesting is scant, this is something Sosenko has seen in her practice, and is in line with the finding that anxiety during pregnancy is linked to one’s susceptibility to postpartum depression.) Noticing this sort of unsatiated anxiety manifested in nesting behaviors gives Sosenko a chance to offer her clients preemptive support before their children are born.

So much of what happens in pregnancy is out of expectant parents’ hands, so it’s no wonder that many seek control when and where they can get it. As Sosenko puts it, nesting “helps us feel prepared for a time in our life when there’s little we can do to prepare.” My own nesting involved a lengthy to-do list. Some of the tasks were relatively straightforward, while others—such as tracking down a paint shade that I’d seen once a few months prior in a real-estate listing posted in an office window—were more or less ridiculous. The latter were naturally more thrilling to accomplish. When I finally found the right swatch, I felt superpowered.

This was just the sort of needlessly difficult task I craved most during pregnancy—it served as a gauge of my ability to achieve things that feel impossible at the outset. For me, as I suspect is the case for other expectant parents, this was necessary emotional preparation as I spent nine months waiting for the most impossible-seeming thing on the planet—the creation of a living being—followed immediately by the further impossibility of tending with grace and patience to the lifelong task of parenthood.

I gave birth on a Tuesday morning in a labor-and-delivery unit so jam-packed that I ended up laboring for two hours in the hallway. I like to think that I was at least somewhat fortified for this unpredictable and anxiety-producing feat by the fact that, just a few days prior, a ship had finally crossed the sea from Pruszcz Gdański. The perfect rug was waiting for us at home.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.