Quote: History gradually got rewritten to suit political and religious development.
That's the problem. The period of time when Judah and Egypt would have been competitors was exceedingly short. Babylon revolted against Assyria in 626 BC and 10 years later had evicted them from Babylonia. Four years later, in 612 BC, Nineveh was sacked and destroyed. The 26th Dynasty of Egypt, formerly Assyrian vassals themselves, stayed loyal and joined the Assyrians in an effort to stop the Babylonians. The Assyrians were forced to move their capital to Haran and to concentrate their military force remaining to protect their capital. This left the northern areas of Palestine open to Judahite dreams of glory but it was also the former seat of the Egyptian empire in Canaan.
Finkelstein notes that the brief period between 616 and 609 or so, there would have been an actual reason for Egypt to be portrayed as an enemy who was once before defeated by "Israel." Redford notes that there are 7th century place names in the exodus tale which were anachronisms which did not exist in the Late Bronze Age.
Finally, 2 Kings 22 gives us some line of shit about how "Josiah" sent some bozo to the "temple" ( which most likely did not exist at all ) to refurbish it and he found the "Book of the Law" which told them everything they had been doing wrong. So, actually, unless you want to believe bible bullshit, it does sound as if a piece of propaganda was brought forward to encourage the people to undertake a struggle against Egypt...which did not last very long as Necho II called Josiah to Megiddo and whacked him. Later, in the Book of Chronicles, they invented a battle so Josiah could die heroically instead like some mafia wise-guy who got fitted for concrete galoshes. It was subsequently re-worked in the Hellenistic Age when an actual independent jewish kingdom arose and became something of a regional power. The time line for his is around 110-98 BC.
So, yeah. A story could have been concocted to mobilize people on short order. Do I have to remind you how quickly George Bush manufactured the WMD bullshit story for his "war?"