The Lord continues to reaffirm his commission to Moses to perform the wonders God had commanded, but also warns that God will harden Pharaoh’s heart (4:21). The Lord also gives Moses a difficult message to give to Pharaoh when he refuses to release Israel. Israel is like a firstborn son, precious and special to God (4:22). YHWH says to Pharaoh: I told you to send away my son that he might serve me (4:23a). Pharaoh had been making Israel serve Pharaoh (1:13-14; 6:5), and planned to continue to do so (5:18). Now, however, YHWH demanded that Pharaoh let them serve YHWH (7:16; 8:1, 20; 9:1, 13; 10:3, 26). The LORD alone is God, and his people must serve and worship him alone (Exod 20:5; Deut 5:9; 6:13).
In some ancient Near Eastern legal customs, whatever one did to another’s child could be done to one’s own child; but certainly one dare not do harm to anyone precious to a powerful deity. Because Pharaoh (whose predecessor had drowned Israel’s babies) refused to release God’s firstborn, God would kill Pharaoh’s firstborn (4:23). In God’s mercy, he provided various warning plagues first; but the final plague, the one that would break Pharaoh’s resolve enough to let the Israelites leave the land, would be the death of the firstborn, both Pharaoh’s and his people’s (11:5; 12:29).
The Bible is very realistic: in this world, people do wicked things to other people. But those who do such things had better watch out. And especially when they do it to God’s own children, to those special to God because of their special trust in him, they had really better watch out. God does things different ways every time, so this is no prediction that God will always slay the sons of Pharaohs. It does remind us, however, that justice will ultimately come about (cf. also Rev 18:20-24).