This week’s Torah portion brings the first seven of what will turn out to be ten plagues: blood, frogs, lice, and on through hail. Pharaoh knows why the plagues come, and he knows what it takes to make them stop: “Let my people go,” Moses has told him.

But Pharaoh does not let the Israelites go, and the plagues do not stop. Even when Pharaoh seems to have learned his lesson and promises to free the slaves, he reneges after the plague ends – and a new plague follows.

What explains Pharaoh’s insistence to act contrary to his own, and his country’s, interest?

“And God hardened Pharaoh’s heart,” says the Torah.

Which raises the question: By what right does God punish Pharaoh for acting with a hardened heart?

Yet was his behavior really that inexplicable? Was his heart harder than ours would be?

Experimental psychologists increasingly have discovered that people are not rational. We are wired to make mistakes in judgment that are not rational – but that are deeply human. The road that Egyptian leadership takes from last week’s portion – when a Pharaoh frightened by alien Hebrews enslaves them – to two weeks from now, when Pharaoh and his army are drowned, is not uniquely Egyptian, or necessarily the result of Divine intervention. It is prototypically human.

At the beginning, Pharaoh looked out and saw the Hebrews who live in Egypt – but were not fully assimilated. Yet, the midrash tells us, they were close to assimilating. True, they had different habits; they ate different food. But they were so close to assimilating, the midrash said, that they were 98 percent of the way from complete assimilation and so from not being redeemed.

Psychologically, though, irrational fear of people and groups that are different is natural.

So too is singling out a feared group for special treatment.

But those responses are hardly rational: They serve only to enhance group identity. Ironically, it was the persecution that forged a nation from the children of Israel. More recently, look at how much stronger American Jewish communal institutions were back when much of American society was closed to Jews.

Slavery certainly brought economic benefit to Egypt – though surely less than was promised when the idea was first suggested to Pharaoh by his advisers. Once the practice had been established for the better part of a century, it must have seemed unimaginable to end it. Economic dislocation is hard. The American South couldn’t imagine an economy without slaves, so it fought a war to preserve it. Police departments used to the proceeds of draconian forfeiture laws and private prison corporations lead the lobby against marijuana legalization. Change is hard. One could easily imagine that the latest plague – vermin, boils, marauding animals -soon would end. Hadn’t the water been restored? But who could imagine the Egyptian economy without Hebrew slaves?

Not only was it unimaginable. One fallacy mortals are heir to is the sunk cost fallacy. In deciding on a course of action – whether to continue watching a mediocre movie or to continue waging a disappointingly unsuccessful war – we irrationally place too much value on the time or money or lives already spent. In deciding to spend the next hour watching a disappointing film, how we spent the past hour rationally shouldn’t factor in – but it does. In deciding whether to free our slaves and avoid the next threatened plague, having painfully toughed out blood, frogs, and lice shouldn’t have factored into Pharaoh’s decision – but it did.

It’s also fair to guess that running a slave state – one that at least once tried outright genocide – had more than a little dehumanizing effect on Pharaoh and his leadership clique. For the safety and glory of the kingdom, Egypt had enslaved Hebrews and drowned their babies. Now they were being asked to endure some suffering – a mere handful or two of plagues – for the same greater good. Pharaoh hadn’t let the sentimental appeal of Hebrew babies interfere with the needs of his nation. He is not some bleeding heart who buckles under pain. He is clear-minded, resolute, and hard-headed – or is that hard-hearted? Not until the plague strikes a person who he can’t help but view as a person – his own son – does the hard-headed heart melt away. Go, he says, as Egypt buries its dead. But one week later, the mourning is over, and again Pharaoh follows bravado and unyielding resolve…. into the morass of the Red Sea.

Looking at Pharaoh’s actions this way takes some of the onus off God – and requires us to look inward. If Pharaoh destroyed his kingdom because of irrational yet natural ways of thinking, are we immune? Has God planted in us the seeds of our own hardened hearts? What damage are we inflicting on our own kingdoms, our own lives? Where are we acting through fear rather than hope?

The challenge, writes Paramus native Rabbi Shefa Gold in her book “Torah Journeys,” “is to keep the heart open in the face of prolonged suffering and to let the seeds of freedom grow in the darkness.” And if we fail in that, as we often will, “the challenge is to bring beauty and tenderness and compassion to the heart, to soften and penetrate the layers of defense that have been built up around it.”

It’s not the easiest task in the world to undertake But as Pharaoh’s example in this week’s portion shows us, it may be more rational than not.