The predilections of these two writers for photographing and spending excessive amounts of time with other people’s children may appear suspect to modern sensibilities, but Carroll and Barrie knew what children wanted in their stories precisely because they were so deeply invested in finding ways to win their attention and affection in real life.

These days, few writers spend a lazy summer afternoon taking a boat ride on the Thames with the daughters of a college dean, as Carroll did, or performing tricks with a St. Bernard and telling children stories in a public park, as was Barrie’s habit. Inspiration for many of today’s children’s stories seems to come from not-so-childish sources. For example, according to Ms. Rowling, dementors, those creatures who drain “peace, hope and happiness out of the air around them,” were inspired by her own experience with clinical depression.

Children today get an unprecedented dose of adult reality in their books, sometimes without the redemptive beauty, cathartic humor and healing magic of an earlier time. In “The Hunger Games,” the series that best exemplifies this shift, Neverland and Wonderland have been replaced by Panem, a country built on the ruins of what was North America. In an interview, Ms. Collins traced the origins of the books to her anxieties as a child about the possibility that her father might die while fighting in Vietnam. Then, reading the story of Theseus and the Minotaur, she imagined the horrors of parental powerlessness in the face of child sacrifice. The personal mingled with the mythical, then the banal fused with the tragic. While channel surfing years later, Ms. Collins found herself switching between a “Survivor”-style reality show and footage of young people fighting in a real war zone. The lines blurred, and “The Hunger Games” emerged.

In the trilogy (as in Salman Rushdie’s “Luka and the Fire of Life,” in which a boy must try to save his father from certain doom), mortal combat takes a video-game-like turn. It’s hard to imagine that we won’t see more books like these, inspired by our shared world of electronic media rather than by the imaginative play of children.

No one is about to slam the brakes on these new engines of storytelling, nor should they. There is much to say in favor of the move to obliterate the divide between books written for children and adult fiction. “There are some themes, some subjects, too large for adult fiction,” Mr. Pullman once declared. “They can only be dealt with adequately in a children’s book.” That insight does much to explain why so many adults can be found browsing books in the children’s section and why books for children and young adults dominate best-seller lists. These writers have successfully produced new literary contact zones for adults and children, with monumental narratives about loss, suffering and redemption.

Still, it is hard not to mourn the decline of the literary tradition invented by Carroll and Barrie, for they also bridged generational divides. No other writers more fully entered the imaginative worlds of children — where danger is balanced by enchantment — and reproduced their magic on the page. In today’s stories, those safety zones are rapidly vanishing as adult anxieties edge out childhood fantasy.