With Parshas Vaera, the process of subjecting Pharaoh and Egypt to a series of plagues begins. Certain plagues Pharaoh resists. Others he is intimidated by and submits to.
Is there a pattern?
Moshe and Aaron turn the Nile to blood, and despite the disturbing threat to the survival of a nation that depends on the river, we are told that "Pharaoh turned and went into his house". (Shemos 7:23)
And so for the next plague, G-d sends a more personal threat to Pharaoh. The frogs will "go up and come into thy house, and into thy bed-chamber, and upon thy
bed, and into the house of thy servants, and upon thy people, and into
thine ovens, and into thy kneading-troughs."
G-d places the order of the infestation as the order of importance that these events have to Pharaoh.
When his people were suffering, Pharaoh retreated to his house, his palace, and let his people dig for drinking water. But now the plague, even though seemingly less harmful and threatening, will impact directly on him, and make its way into his most intimate quarters leaving him no place to retreat to.
If he enters his home, the plague will be there. If he locks the door of his bedchamber, he will not escape it.
For the first time, Pharaoh surrenders. And he pleads with Moshe to "take away the frogs from me, and from my people". First comes Pharaoh. Then come his people.
The next plague contains no mention of Pharaoh's home and so he does not surrender. But the plague after that, wild beasts, does. It first comes "into the house of Pharaoh" (Shemos 8:20) and once again Pharaoh frantically submits. And Moshe, very aware by now of Pharaoh's set of priorities, promises that the plague will be removed from, "Pharaoh, from his servants, and from his people".
The next plague kills all the cattle, but does not affect Pharaoh and so he does not submit. The plague after that causes plenty of human misery, but again does not seem to affect him in particular either.
After that, G-d sends a more direct message to Pharaoh, "I will this time send all My plagues upon thy person, and upon thy servants, and upon thy people". And yet this time the plague, hail, does not appear to affect Pharaoh particularly. Yet once again there is a mention of houses.
"Now therefore send, hasten in thy cattle and all that thou hast in the field; for every man and beast that shall be found in the field, and shall not be brought into the house, the hail shall come down upon them, and they shall die.' He that feared the word of the LORD among the servants of Pharaoh made his servants and his cattle flee into the houses;" (Shemos 9:19-21)
The moral was a simple one. Each time Pharaoh had determined his response based on what the personal impact upon him was. If the plague affected his "house", he summoned Moshe and pleaded for relief. If it didn't, he allowed his people to suffer.
"House" had come to stand for selfishness. A personal space that a man could use to shut himself off from the pain of others.
Pharaoh's house was his ego.
The plague of hail offered Pharaoh and other Egyptians a chance to save not only their livestock, but their servants, as long as they were willing to listen to G-d and open up their houses. If they wouldn't, they would ultimately suffer.
It is this which causes Pharaoh to submit for the first time, even though he isn't personally threatened, with a unique admission of guilt. "And Pharaoh sent, and called for Moses and Aaron, and said unto them: 'I
have sinned this time; the LORD is righteous, and I and my people are
the wicked ones."(Shemos 9:27)
With the next plague, locusts, with its threat of them filling "thy houses and the houses of all thy servants", Pharaoh attempts to preemptively surrender, but then hardens his heart. The final plague strikes all of Egypt, including the house of Pharaoh, so there is "not a house where there was not one dead."
The climax of the selfishness, the lack of empathy which had brought Pharaoh and his people to this pass, their lack of concern for anyone outside their own "house" was that every house had to suffer the ultimate price.
In sharp contrast to this are the midwives who defied Pharaoh's decree to kill the Jewish firstborn. As a reward, "And it came to pass, because the midwives feared God, that He made them houses." (Shemos 1:21).
"If the Lord does not build the house, its builders labor in vain." (Psalms 127:1).
Pharaoh exploited Jewish labor on massive construction projects for his own glorification, only to see it all come apart. The Egyptian ruler had put his trust in physical houses, in fortifications that he could use to leverage his power, hiding behind walls, but G-d could penetrate those walls in any number of ways.
The House of Egypt was built on selfishness, on disregard for others, and so its punishment lay in forcing Pharaoh to recognize his own guilt, not his hostility toward the Jews, as neither he nor the Egyptians would have considered that a crime, but his disregard for his own people and everyone who wasn't him. This was the point that G-d made in the plague of hail. G-d showed more regard for the Egyptians, even as He was punishing them, than Pharaoh ever did.
Jewish houses were built by G-d based on values. They could not and would not endure without them. The houses of the midwives were dynasties, not mere buildings. Many of the houses of Egypt still survive as curiosities and wonders, but the people are long gone while the dynasties of the midwives still endure.