Kerry Fender didn’t plan to leave her job after her daughter was born.

She had worked out an 8-month maternity leave with the Catholic school in Silicon Valley where she worked. “My employer was supportive, I liked what I did, and I loved my co-workers,” said Ms. Fender, 38 years old. “I had all of that going for me.”

But Ms. Fender hadn’t...