Pharaoh in Nineveh? What are you talking about? Pharaoh was the king of Egypt.
All true, but that is the kind of imaginative leap that midrash can make. Midrash is the elaboration of Scripture by Jewish sages in the centuries following the Roman destruction of the Temple in 70 C.E. The rabbis knew their text, all right—every letter of it. They asked all kinds of questions of the text. They saw all kinds of possibilities in it. They made all kinds of connections. Reading their midrashim, we not only marvel at their imagination and the connections they were able to make, but we also learn to understand the biblical text better. As they themselves put it, “Turn it and turn it again, for everything is in it.”1
Which end of the story the rabbis started from is unknown. Did they find a need to explain the repentance of Nineveh? Or did they notice a lacuna in the text of Exodus? We’ll begin at the Red Sea.
After he finally allowed the Israelites to leave Egypt, we are told, Pharaoh had “a change of heart” (Exodus 14:5). “He took 600 of his best chariots, and the rest of the chariots of Egypt, with officers in all of them…and he gave chase to the Israelites. As the Israelites were departing defiantly, the Egyptians gave chase to them, and all the chariot horses of Pharaoh, his horsemen, and his warriors overtook them encamped by the sea” (Exodus 14:7–9).