In many Prayers and weekly Torah readings, we thank G--d for taking us out of Egypt. But since G--d was the one that put us there, why are we thanking him for taking us out?
I can even make this question a lot more general - G--d knows all and creates all. When things happen it is because G--d made it that way. So why should we be thanking Him for things that are just... reality?