In this week's Parsha, we are told of some of the complaints of Bnai Yisrael while they were in the wilderness. After all the great miracles Hashem had performed for them, including the splitting of the Red Sea, Bnai Yisrael still had the nerve to lament over their situation, saying that they had been better off as slaves in Mitzrayim and Hashem shouldn't have set them free so that they would simply die of thirst in the desert (שמות י"ז:ג').
One of their major complaints was about a lack of drinking water. In order to provide for them, Hashem commanded Moshe to bring forth water from a rock (שם פסוק ו'). Although Hashem did give them what they wanted, it is easy to see why He would be angry at Bnai Yisrael because of these events. After all, they did not merely ask for water, which would not necessarily have been considered an unreasonable request, they actually questioned whether Hashem was truly in their midst or not (שם פסוק ז'). Sure enough, Amalek soon attacked them (שם פסוק ח'); this was a punishment for their complaints.
Rashi (שם בד"ה ויבא) comments that one can compare this series of events to a story about a father who places his child on his shoulders to protect him from the dangers of the road. As they walk, the father provides the child with whatever he needs. After much journeying in this manner, the child suddenly asks a stranger on the road, "Have you seen my father?" This total lack of appreciation or even acknowledgement of his existence angers the father to the point that he puts the child down in the road, unprotected, and a dog bites him. Similarly, Bnai Yisrael, after having been "carried" by Hashem through all His miracles, suddenly wonder if He is actually in their midst. Hashem angrily responds to this by having Amalek attack them so that they will see what happens without Hashem's protection.
Someone who fails to see the hand of Hashem protecting him is considered by the Torah to be lacking in Yiras Shamayim, fear of Hashem. For this reason, the Torah, when recounting the events with Amalek much later on, refers to Bnai Yisrael, according to some commentaries, as not being G-d fearing (דברים כ"ב:י"ח). We must all try to recognize Hashem's constant presence and not ignore His direct involvement in our day to day lives so that we may prove ourselves worthy of His loving fatherly protection at all times.