>>149343337There are actually a few theories about that.
1: It's a cultural memory of the Hyksos, a related Semitic peoples from Canaan that invaded and briefly ruled over Egypt before being expelled.
2: Some proto-Hebrew people (likely if not almost certainly warriors, not the whole damn country) actually did get enslaved as a result of Egypt conquering Canaan. Some escaped and over the centuries their tales got telephone gamed into the Exodus story.
3: Some Atenist priests escaped into Canaan after the Amarna period and gained some followers that began a monotheist cult that eventually became Judaism. Moses was either their high priest or Akenaten himself that became a separate character to the pharaohs as the centuries passed and the original context was lost.
4. Egypt was the regional superpower at the time and making up a story about your God beating up their gods would have seemed impressive, and most people had zero historical knowledge with which to refute the story.