Well, let's clear the first misconception:
Fairy tales aren't for children. Or at least, not all of them weren't meant to be for children until much later. Most fairy tales originated as folk tales that peasants and farmers would tell each other, presumably to pass time and lighten the drudgery of working. Zohar Shavit, in an analysis of fairytales in, "The Concept of Childhood and Children's Folktales: Test Case - "Little Red Riding Hood", states that
Up until the nineteenth century, folktales were told and read... by adults (even among the upper class). Children, who were constituted part of adult society, were acquainted with them in the same way, although the tales were not considered meant for them.
And this is pretty obvious when you see earlier European examples of famous fairy tales such as Sleeping Beauty (which involves rape, incest, and cannibalism), Little Red Riding Hood, (which also deals with cannibalism, strip-teasing, and metaphorical rape), and Bluebeard (Perrault's version includes graphic descriptions of violence; gives me nightmares when I think about them). Brothers Grimm were amongst the first to actually have these fairytales be fully intended for children (Perrault had intended for children and adults alike, and you can find many "winks", if you will in his texts).
Now back to how fairytales are so similar. There are two widespread theories on this topic:
The first theory is that all fairy tales originated from a single, or a collection of a few sources that spread throughout the world.
The second theory states that fairy tales stem from common human experiences, and therefore similarities can arise from them.
It is entirely possible that it can be some combination of both, and fairy tales were also most likely transmitted via oral culture through trade, which could account for the similarities. Since it's orally passed down however, it is harder to pinpoint the "origin" of the stories, only the earliest sources of these stories.