ואילו לא הוציא הקב"ה את אבותינו ממצרים, הרי אנו ובנינו ובני בנינו במצרים משועבדים היינו לפרעה
We say in the Haggadah that if Hashem wouldn’t have taken us out of Mitzrayim, we would still be in Mitzrayim. The question is, who says that if Hashem didn’t take us out, we wouldn’t have found some other way out? Moreover, why did Hashem take us out with a Yad Chazakah, strong hand, why didn’t he simply put into Pharaoh’s heart that he wants to send out the Jews?
The sefer Maaseh Hashem (Vol. 2, pg. 23b) explains that these two questions answer each other. If Hashem wouldn’t have taken us out of Mitzrayim, and Pharaoh would have sent us out on his own accord, then we would be constantly indebted to show hakoras hatov to him, as a slave who is freed by his master due to his masters good will is forever indebted. Therefore, Hashem took us out with a Yad Chazakah and drowned the Egyptians at sea. This why, we are obligated to give thanks to Hashem alone for all His miracles and wonders, however, we are not indebted whatsoever to give thanks to Pharaoh.