I knew something was up when Sandhya, a talented project manager I only knew slightly, asked me if we could have lunch.

She had recently come back from maternity leave. In her note, she said she wanted some advice from another mom.

Over lunch, she confided in me that she was thinking of quitting. It was too hard to juggle everything. Her manager had pressured her to return from leave early, and was pushing her again to take a business trip and leave her nursing infant at home. She wasn’t sleeping. She felt like she was failing her job and her child at the same time.

I assured her that her feelings were normal and that much of it would pass. I encouraged her to say no to her manager. I offered to speak to him on her behalf. Although she earned more than her husband did, she quit two weeks later.

That was four years ago, and Sandhya still hasn’t returned to the tech industry. She has no plans to. She has since had another baby. Her story has haunted me since. She came looking for support, and I felt like I failed her.

Over the last month, I have collected stories from 716 other women who have left the tech industry. Their average tenure in the industry was a little over seven years. All of them shared their single biggest reason for leaving, their current employment status, and their desire (or not) to return to tech.

Motherhood as just the final push

Like many of the women I surveyed, Annabelle is highly educated; she has a PhD in linguistics and a master’s degree in computer science. She is one of 484 women to cite motherhood as a factor in her decision to leave tech. Unlike the 42 women who said they wanted to be stay-at-home mothers, Annabelle’s decision to leave was not planned:

I was the first and only person at my small company ever to take maternity leave. They had no parental leave policy previously even though they had been around for about a decade, and, having under 50 employees, weren’t covered by FMLA. I (cluelessly!) agreed to go back to work part-time starting when my daughter was six weeks. There was no set place for me to pump [breast milk] while I was at work, so it was perpetually inconvenient and awkward to work at the office for longer than a couple hours at a time.

Eighty-five women cited maternity leave policy as a major factor in their decision to leave their tech jobs. That’s over 10% of the women I surveyed. Caitlin, who worked as a data center developer for over a decade, said the following:

I negotiated 12 unpaid weeks off when my son was born. Only it wasn’t really time off. I didn’t have to go to the office every day, but I was expected to maintain regular beeper duties and respond within 15 minutes any time there was a problem. I’d be nursing my screaming baby and freaking out that I was going to get fired if I didn’t answer the beeping thing right away.

Many women said that it wasn’t motherhood alone that did in their careers. Rather, it was the lack of flexible work arrangements, the unsupportive work environment, or a salary that was inadequate to pay for childcare. As Rebecca, a former motion graphics designer, put it, “Motherhood was just the amplifier. It made all the problems that I’d been putting up with forever actually intolerable.”

“Everyone’s the same, and no one’s like me.”

One-hundred-ninety-two women cited discomfort working in environments that felt overtly or implicitly discriminatory as a primary factor in their decision to leave tech. That’s just over a quarter of the women surveyed. Several of them mention discrimination related to their age, race, or sexuality in addition to gender and motherhood. Dinah was a front-end developer for eight years before deciding to call it quits:

Literally 28 of the 30 people in our company were white, straight men under 35. I was the only woman. I was one of only two gay people. I was the only person of color other than one guy from Japan. My coworkers called me Halle Berry. As in, ‘Oh look, Halle Berry broke the website today.’ I’m pretty sure for some of them I’m the only actual black person they’ve ever spoken to. Everyone was the same, and no one was like me. How could I stay in that situation?

Never going back

Of the 716 women surveyed, 465 are not working today. Two-hundred-fifty-one are employed in non-tech jobs, and 45 of those are running their own companies. A whopping 625 women say they have no plans to return to tech. Only 22—that’s 3%—say they would definitely like to.

Stella, a senior leader with almost 20 years of experience in engineering, talks about her experience quitting and starting an ecotourism travel company:

I love coding. I have a masters in CS [computer science]. I worked in tech for two decades. So many women like me, so highly trained and for what? It was hard enough being the only woman on most projects. Try being the only woman over 40. Doesn’t matter how good you are, or even if your colleagues respect you. Eventually you get tired of being the odd duck. I took all my experience and started my own thing where I could make the rules. I’m never going back.

The pipeline isn’t the problem

It is popular to characterize the gender gap in tech in terms of a pipeline problem: not enough girls studying math and science. However, there are several indications that this may no longer be the case, at least not to the extent that it once was. High school girls and boys participate about equally in STEM electives. Elite institutions like Stanford and Berkeley now report that about 50% of their introductory computer science students are women. Yet just last year, the U.S. Census Bureau reported that men are employed in STEM occupations at about twice the rate of women with the same qualifications.

Almost everyone I spoke with said that they had enjoyed the work itself. Most mothers added that they would have happily returned to their jobs a few months after giving birth, but their companies didn’t offer maternity leave and they needed to quit in order to have their kids. Some women felt that their work environments were discriminatory, but most reported something milder: the simple discomfort of not fitting in in an otherwise homogenous setting. It may not sound like a big deal if you’re used to being in the majority, but it was enough to drive many qualified engineers to quit.

There may be work to do on the pipeline, but the pipeline isn’t the problem. Women are leaving tech because they’re unhappy with the work environment, not because they have lost interest in the work.

As cultural issues go, this is an incredibly expensive problem. Like my friend Sandhya, these women are educated, highly trained, and weren’t planning to quit. We’re losing them anyway. And once we’ve lost them, we almost never get them back.