Fairy tales originate from two things:
→ an exageration of a real event
→ a flight of imagination
It is likely there was some cross-breeding between those sources.
Fairy tales are entertaining.
Sometimes they teach something that is good.
Sometimes they teach something that is bad.