These are called the great myths. Like the epic of Gilgamesh, Troy, and so on these stories have been primarily narrated not written. There is definitely fact in there but the function of such stories is not to record history but to assemble the presence of an ever.complex society and the existential questions that it poses. Therefore, these stories are supposed to be read symbolically.
Secondly, there are definite historical facts in there. Take Homer's epics, we have found the historic Troy and evidence of warfare there so there is evidence that such a war took place and probably the heroes in there are based on real people but treated more literally.
My own field is narratology if you've any more questions shoot away and I hope it helps