The Torah in Parashat Ki-Teseh presents the Misva of Shilu’ah Ha’kan, which requires sending a mother bird away from the nest rather than taking it together with the eggs. One of the unique features of this Misva is that it applies only when one chances upon a bird’s nest. The Torah writes, "Ki Yikareh Kan Sipor Lefanecha Ba’derech" – "If a bird’s nest happens to be before you along the road" (22:6), clearly indicating that the Misva applies only if one happens to chance upon a nest.
Interestingly, we find the concept of "Yikareh" – something happening "by chance" – at the very end of this Parasha, as well. There the Torah commands us to remember Amalek’s attack against Beneh Yisrael, and it describes how "Asher Karecha Ba’derech" (25:18) – Amalek "chanced upon you along the way." The Rabbis explained this to mean that Amalek attacked Beneh Yisrael not only militarily, but also ideologically. Amalek championed the belief in happenstance, that the world runs randomly without any rhyme or reason. According to this belief, there is no cause or explanation for anything, as all events on earth occur randomly and are not controlled by any overarching force.
Our response to Amalek is the Misva of Shilu’ah Ha’kan. The Torah commands sending away the mother bird so it does not experience the pain of seeing its young being taken away. It is an act of sensitivity of compassion. But the Torah emphasizes that this is purely "by chance." We are to show this sensitivity only to a bird, and only in the specific instance when we happen to pass by a nest and want to take eggs. It seems entirely arbitrary that this particular bird is given compassion and spared the pain of watching its eggs being taken. When we comply with the Misva, we show that we trust that Hashem has a plan and everything is calculated. We trust that there is good reason why specifically this creature at this particular time is to be shown compassion, and so we send away the mother bird. Whereas Amalek believed that everything happens by chance, we believe that everything is orchestrated by G-d. And thus even "Ki Yikareh," when things seem to happen arbitrarily, we are not deterred, and remain faithfully devoted to fulfilling Hashem’s commands.