The Wizard of Oz falls within the genre of children's literature. It wasn't until the 18th and 19th centuries that people began treating children as a separate demographic from adults. As people began considering the specific needs, interests, and desires of children, many writers began creating books aimed at them. The end of the 19th century, when Baum wrote The Wizard of Oz, is known as the Golden Age of Children's Literature because of how many classic children's books were published during this time.
There are several things that make The Wizard of Oz a children's book. First, it takes seriously the inner life of its young protagonist, Dorothy. Rather than featuring Dorothy as an object in an adult world, the book focuses on her feelings and growth throughout her journey in Oz. Children's literature aimed at all different age groups has become enormously popular in the last several decades, so it is easy to take for granted that a book featuring a child would represent their perspective on the world. When Baum was writing, this was still a newer idea. It was not unheard of, but it did mark the book as part of the trend of books written for and about young people.
The book also has short, action-packed chapters that make it good for reading aloud over the course of many sessions. For instance, there is a separate chapter about the way Dorothy meets each one of her friends in Oz. By including natural stopping points between important moments in Dorothy's journey, Baum suggests a structure by which children and adults can read the story together and reflect regularly on its lessons.
Baum's book could also be considered a long fairy tale. Fairy tales were originally intended for adults and contained very dark themes, but the 18th and 19th centuries saw them converge with the new genre of children's literature. Baum uses conventions of the fairy tale to convey lessons in morality to his young readers. For instance, he uses "wicked" and "good" characters to explore the dichotomy between good and evil. He places a "normal" child in a fantastical environment, where she must navigate a series of magical obstacles as she learns about herself. He also uses repetition, such as the repeated appearance of the Flying Monkeys, to help young readers follow along with Dorothy's development. All these elements have roots in both the fairy tale genre and the genre of children's literature.