Exodus 11:4-8, 12:29-30
So Moses said, "This is what the Lord says: 'About midnight I will go throughout Egypt. Every firstborn son in Egypt will die, from the firstborn son of Pharaoh, who sits on the throne, to the firstborn son of the slave girl, who is at her hand mill, and all the firstborn of the cattle as well. There will be loud wailing throughout Egypt-worse than there has ever been or ever will be again. But among the Israelites not a dog will bark at any man or animal.' Then you will know that the Lord makes a distinction between Egypt and Israel. All these officials of yours will come to me, bowing down before me and saying, 'Go, you and all the people who follow you!' After that I will leave." Then Moses, hot with anger, left Pharaoh.
At midnight the Lord struck down all the firstborn in Egypt, from the firstborn of Pharaoh, who sat on the throne, to the firstborn of the prisoner, who was in the dungeon, and the firstborn of all the livestock as well. Pharaoh and all his officials and all the Egyptians got up during the night, and there was loud wailing in Egypt, for there was not a house without someone dead.
Why would God punish the entire population of Egypt by killing even firstborn infants for something Pharaoh did? While Pharaoh was responsible for bringing the plague upon the people by his refusal to obey God, the Egyptians were also rejecting God by worshiping false gods and by cruelly enslaving the Israelites.
Having lived with the Israelites for over 400 years, the Egyptians would have heard about God and what he had done. They would also have heard about the signs Moses and Aaron performed (e.g. Ex 7:8-12) and seen firsthand the previous nine plagues, noting they affected Egypt but not Israel. This should have been a clear enough sign for anyone that the Israelites' God was powerful and should be listened to. Indeed, some of the Egyptians were able to escape the effects of the plagues when they heeded God's warnings and acted accordingly. Those who took shelter when God warned them of the plague of hail survived (Ex 9:19-21). Additionally, the plagues demonstrated the impotence of various Egyptian gods (see for instance Ten Plagues of Egypt).
As with the other plagues, the Egyptians were warned in advance of the plague on the firstborn. Had an Egyptian family gone to ask the Israelites how to serve their God and avoid the plague, they could have received the instructions for the Passover and thus spared their family. Their failure to do so indicated they still didn't believe God's word and were still rejecting him, hence the plague.