Shemos
The Gemara states that the reason Pharaoh decreed for all boys born to be thrown into the river, was because his astrologers said that the savior of Bnei Yisrael will be struck by water. Out of his great fear, Pharaoh decreed that all the sons of Bnei Yisrael, and even of Mitzrayim, should be thrown into the water. All of this action was just for the purpose to be saved from Moshe Rabeinu assisting Bnei Yisrael and leading them out of Mitzrayim.
This was Pharaoh’s plan, however as the saying goes, “people think and do but Hashem laughs.” The result with this plan was that the daughter of Pharaoh himself was the one who saved Moshe Rabeinu from the water, plus Pharaoh himself raised Moshe Rabeinu in his own palace. The Steipler points out that it was through this very decree itself that Bas Pharaoh found Moshe, saved him and brought him into Pharaoh’s palace. From here, says the Steipler, we see that all people’s actions and tricks won’t change what was decreed in shamayim, not even a little bit. Not only that but even more, the very action that one does to bring out his own personal desire will be the very action which will bring out the decree of Hashem!
We also find this by Yosef. He dreamed that he would be the king and controller, and the brothers would bow down to him. The brothers were jealous and hated him, they said, “we will see what will be with his dreams!” They ended up throwing him into the pit from which they sold him to Mitzrayim where Potifar bought him. Then he got thrown into jail, and from there he was taken out to interpret Pharoah’s dream. Because of this Yosef became second in command of the whole Mitzrayim! The brothers’ intention was to prevent Yosef from becoming king as a slave couldn’t be king, but the outcome was that even so, he became king and the dreams were fulfilled! Here too, we see, that which people do to prevent the will of Hashem, on the contrary, it won’t stop it even slightly, rather it will only help to bring out the ratzon Hashem.
May we pay attention to hashgacha pratis and notice the yad Hashem!