This is an example of a type/antitype (there is way too much to post of just this one example of the Israelites being a type). But this is just one aspect of it.
God's message to humanity - I believe - was a progressive unfolding. Pharaoh would not have understood fully what was meant by Israel being called "the firstborn son"....but these Scriptures were memorized for numerous centuries by the time of God’s incarnation.
Israel was the
firstborn son ....Jesus is the "only
begotten Son" (God incarnate) through whom we become "children of God":
John 1:12-13 ~ But to all who did receive Him, to those who believed in His name, He gave the right to become children of God—children born not of blood, nor of the desire or will of man, but born of God.
"Firstborn" was just the beginning. Remember God's promise to Abraham (that his descendants would be too numerous to count)? Genesis 12:3 and 22:18 say that God promised all nations would be blessed through Abraham and his seed. He chose the nation of Israel to be a type of kingdom of priests and a holy nation (exodus 19:6) to serve Him and be a light to the gentiles (but that wasn't the fulfillment - they weren't all priests). Israel was to fulfill His purpose of reconciling the fallen world back to Him through the promised seed. We then see who that seed (singular) is. Christ fulfilled what humanity fell short in:
Galatians 3:16 ~ The promises were spoken to Abraham and to his seed. The Scripture does not say, “and to seeds,” meaning many, but “and to your seed,” meaning One, who is Christ.
.
...and He made a way for us to be His children:
Galatians 3:29 ~ And if you belong to Christ, then you are Abraham's descendants, heirs according to promise.