כה אמד ה׳ בני בכורי ישראל. Thus said the Lord: "Israel is My firstborn son." Why is this prophecy- i.e. that the Jewish firstborn would not be killed- recorded out of context, i.e. a long time before Moses would announce it to Pharaoh? We need to know also why, apparently, Moses was not to mention this to Pharaoh on their first encounter?
It appears that G'd in His wisdom provided Moses with some information which would temper his disappointment at the long drawn-out process of the often broken promises by Pharaoh. There was a danger that when Moses observed that Pharaoh remained obstinate month after month despite the plagues G'd inflicted upon him and his people, he would become fed up with his mission. G'd therefore informed him of something that would not happen until the end of the process. As long as the plague of killing the firstborn Egyptians had not occurred, Moses had no reason to believe that G'd's timetable had been upset. The synopsis of the prophecy was: "be aware that I will make Pharaoh's heart obstinate; he will suffer many plagues without collapsing; in the end you will announce to him that G'd will kill all the firstborn Egyptians, etc."
G'd was also clever in announcing to Moses in this fashion that it would be the plague of killing the firstborn which would prompt Pharaoh to dismiss the people. Moses would eventually realise that the redemption was close at hand when G'd did not mention to him anymore that He would harden the heart of Pharaoh. When Pharaoh told him in 10,28: "do not come to see me anymore," Moses realised that the time to fulfil the instruction given in our verse had arrived. This is why he announced that plague the moment Pharaoh told him not to come and see him again. While it is true that the Torah reports many additional instructions G'd gave to Moses at that time, G'd may have mentioned them already at this time while recording them at an appropriate moment. When we look at matters in that light we do not need all the Midrashim which try to determine when precisely G'd had made this announcement. G'd did not worry that Moses would misunderstand and reveal this prophecy too soon. He knew that Moses would report back to Him any response from Pharaoh. As soon as G'd would then instruct Moses to bring on another plague, Moses would know that the time had not yet arrived for that final plague. Once Pharaoh told Moses not to come and see him again, Moses realised he did not have time to consult with G'd outside the limits of the city as he was in the habit of doing. This is why he himself announced the plague of the killing of the firstborn without awaiting specific instructions from G'd. Perhaps Moses simply used the words "I will make Pharaoh's heart hard" as his guidelines. He did not know beforehand how long this process of hardening Pharaoh's heart would continue; when he noticed that G'd did not mention this anymore after the plague of darkness, he took his cue from that and warned Pharaoh of the final plague.
It is also possible that G'd indicated that Pharaoh had three choices. If he were to release the Israelites he would be spared any plagues. If he were to deny the Israelites their freedom without at the same time insulting G'd, G'd would bring on the plague of the killing of the firstborn immediately; this would bring about the Exodus. If, however, Pharaoh were to deny the Israelites their freedom and at the same time insult the honour of G'd, he would have to endure the entire range of plagues, as did in fact happen. G'd told him through Moses in 9,16 that He had decided to let Pharaoh experience the full extent of His power.