James Barrie had promised Charles Frohman, his American producer and friend, that he would create a new play for the American actress Maude Adams before the end of April, 1904. On the day before Sylvia gave birth to Nicholas (nicknamed "Nico"), her fifth son, Barrie started to write that play. It was November 23, 1903.
The main character - Peter Pan - wasn't new to Barrie since he had already created him in The Little White Bird. Nor was the subject matter foreign to the playwright: He had been thinking about boys who don't grow up since his own brother David died. Even Wendy was based on a real person.
Margaret Henley, the daughter of Barrie's friends, adored James and called him her "friendy." Because Maggie couldn't articulate the "r" in "friend," however, from her mouth the word sounded like "fwendy." When little Maggie died, at age six, Barrie immortalized her by giving the name "Wendy" to a main character of the play. In a picture taken not long before her death, Maggie is wearing a cloak. Barrie used that cloak as part of Wendy's stage costume. (George Llewelyn Davies, who was Barrie's main sounding board on the play, was initially displeased at her addition.)
The story begins with Wendy:
All children, except one, grow up. They soon know that they will grow up, and the way Wendy knew was this. One day when she was two years old she was playing in a garden, and she plucked another flower and ran with it to her mother. I suppose she must have looked rather delightful, for Mrs. Darling put her hand to her heart and cried, "Oh, why can't you remain like this for ever!" This was all that passed between them on the subject, but henceforth Wendy knew that she must grow up. You always know after you are two. Two is the beginning of the end.
When Barrie finished an early draft of the play (its working title was "The Great White Father"), he read it to Herbert Beerbohm Tree, then an acclaimed actor-manager. Shocked at what he heard, Tree sent a message to Charles Frohman who was still in the States:
Barrie has gone out of his mind...I am sorry to say it, but you ought to know it. He's just read me a play. He is going to read it to you, so I am warning you. I know I have not gone woozy in my mind, because I have tested myself since hearing the play; but Barrie must be mad. (Quoted in JM Barrie and the Lost Boys, page 104.)