Well, that's what Exodus is going for. This book is mix of history, narrative, and law. And it all comes together to create the basis of a national identity. We get an origin story, a framework for national regulations, and the formation of a national character. Just like the Aeneid defined ancient Roman culture and The Great Gatsby helped define 1920s urban culture, Exodus is instrumental in forging an identity for the Israelites.
Because Exodus is a combination of different kinds of texts, scholars are pretty sure that it has authors from all different walks of the ancient world. Why assemble this kind of text? Why combine different strands of cultural writing? There are a zillion answers to that question, but in the end, all we can know is the effect the text has.
Because Exodus was probably woven together over hundreds of years, it's pretty tough to date. It's not like an archaeological find where you can just carbon date the thing and go home happy. But as a ballpark estimate, we can say Exodus was assembled sometime around 600 BCE, using stories, motifs, and ideas that were much older.
During this period, nations were beginning to codify themselves all over the place. The Greeks were experimenting with democracy and the Romans were starting to organize the Italian peninsula into a cohesive political entity. Exodus is the Israelites' chance to establish their own cultural identity, too.
Whether or not the Exodus actually happened (or when!) isn't what we're worried about here. After all, the story itself has so much clout in our culture that its actual historicity—while cool to think about—has nowhere near as much power as the mythology of what went down.
Exodus is arguably the most important book in the Hebrew Bible. After all, everything that comes after it contends with its themes, ideas, and stories. Many later books—including Deuteronomy and Psalms—conatin retellings of the Exodus story, and Moses continually remains a powerful figure in Israelite mythology.