Nearly four years ago, the novelist Wendy Mills was at the airport with her family when her son Zack asked a simple but wrenching question.

He wanted to know why all the passengers going through security were taking off their shoes. Ms. Mills gave Zack, then 9, a vague reply like, “It’s to keep us safe.” Unsatisfied, he persisted, and eventually, the conversation wove around to the Sept. 11 attacks, which happened before he was born.

Ms. Mills, who lives in Pine Island, Fla., and writes young- adult fiction, realized during that conversation that most of her teenage readers had no direct memory of the attacks. Soon after, she started working on “All We Have Left,” a novel about two teenagers — a Muslim girl named Alia, and a troubled boy called Travis — who are trapped in an elevator in the World Trade Center on the morning of Sept. 11. The novel jumps back and forth between 2001 and 2016, when Travis’s younger sister, Jesse, tries to find out what happened to her brother, who died in the tower, and fights with her grief-stricken father, who has become virulently anti-Muslim.

“I wanted to write a story that made our shared history accessible to them,” Ms. Mills said. “Here’s a whole generation of kids who weren’t alive and don’t know what it was like that day, and they’re not going to know the world before 9/11. It wasn’t a perfect world, but it felt like a safer world.”