Parshat Besalach has the Jews departing Egypt with the Egyptians armies in rapid pursuit. In that process it features two sets of baffling behaviors, one by the Jews and the other by the Egyptians.
The Egyptians behave in a seemingly insane manner, heading off in pursuit of their escaped Hebrew slaves even after the devastation of the ten plagues and even proceed down into the split sea. The Jews by contrast seem to complain endlessly once they are out of the sea displaying little faith in G-d.
In fact both behaviors are ultimately attributable to a lack of faith in G-d, but a different sort of lack of faith. The showdown at the sea follows a long series of punishments visited on Egypt by G-d. Why specifically punish Egypt, a bleeding heart type might ask. Why not have Moshe arrive in Egypt and spend the next decade or so urging Egyptians to repent backed by wonders and miracles, but not by punishments?
The key though is that the Egyptians lacked a specific kind of faith in G-d. A few plagues in Pharaoh had already been convinced that G-d existed and had great power, yet he irrationally continued to refuse to free his slaves. Each plague battered at his resistance, but none fully convinced him, not even the last. Clearly Pharaoh's faith in G-d was lacking in a specific area, the area of punishment.
Successful and prosperous people often believe in G-d but only in a G-d who rewards them but not a G-d who punishes them. That is where you get so many powerful and corrupt religious and lay leaders who profess to believe in G-d and yet behave in completely amoral ways. Like Pharaoh, they believe that when something good happens, it's from G-d, but when something bad happens, they reject a divine role in it. That was why the Pharaoh of Joseph's time was willing to believe in G-d because the famine was preceded by seven years of plenty and resulted in prosperity for him and for Egypt. It did not however make him into a moral leader and the ultimate outcome of his rule was slavery and oppression. Given great wealth, Egypt grew all the more arrogant and brutal.
The lack of faith of the Egyptians was in a G-d who punished in order to enforce justice as a higher moral authority. And so the Egyptians followed their escaped slaves into the desert and into the sea, madly certain that they would succeed. Such self-destructive hatred of Jews has no shortage of contemporary parallels, think of rockets being shot from the rubble of Gaza and Lebanon or Nazi Germany diverting resources from the front to transport and kill more Jews even as the war was being lost. Battered post war Russia plotting to wipe out its Jewish citizens at a time when the country needed to be rebuilt or Spain hounding the last of the Conversos and eliminating entire professions in order to hunt down anyone with Jewish blood.
Where the Egyptian lack of faith was manifested in a failure to believe in a G-d who punishes, as is the way of successful people, the Jews who had been oppressed and downtrodden, lacked faith in a G-d who brings good. As slaves they had no trouble relating to the idea of a G-d who punishes but had trouble believing in a G-d who provides for them, thus their complaints were focused on a lack of food and water.
Arrogance breeds a belief in immunity from punishment, oppression breeds a belief that punishment is only to be expected and a lack of belief in anything positive. Both represented opposite lacks of faith created by their mutual relationship. The Egyptians had grown used to having slaves and refused to accept that they weren't entitled to them. The Jews had grown used to having masters and refused to accept that G-d was a fundamentally different being than their Egyptian masters.
True understanding of G-d takes in the fact that he delivers both punishment and blessing, yet it is often easier to pick one or the other and practice dualism, to see G-d as a source of punishment or blessing exclusively, rather than both. By drowning the Egyptians in the same sea that he used to lead the Jews to safety, the unity of G-d was conveyed and yet not properly understood.
To this day if one looks at Israel, many Haredim are eager to believe that the 39 scud missiles that fell during the Gulf War were a punishment for violating Shabbat but few were willing to believe that the Six Day War and the Creation of Israel were a blessing from G-d. Vice versa, many "traditional" Jews are willing to believe that victories in wars are divine blessings but fewer are willing to believe that there are direct divine punishments too. Yet it is not one or the other, true understanding of G-d demands that it be both.