Exodus 4:23 And I say unto thee, Let my son go, that he may serve me: and if thou refuse to let him go, behold, I will slay thy son, even thy firstborn.
God told Moses before he ever got there what was going to happen. Only God can do that. Only God knows what will happen before it happens.
Moses needs to realize that God has called Israel His firstborn. If they refuse to let them go then God will bring judgment on their firstborn.
This is a clash of gods. The One and Only true God tells Pharaoh that He is God and that He can defeat them. Now Pharaoh is stuck with believing his false god or the real God. In pride Pharaoh will choose what he believes and pay the consequence!