Man has free will. Yet HaShem's Divine Providence governs all things and everything is encoded within the Torah. Don't worry about it, don't try to rationalize it. Accept it.
I have to disagree here. The key to man's relationship with God is, IMO, that we were created in His image. Not a physical image (obviously), but spiritual image.
As such, we have free will. As such, we must be allowed to grow up and exercise our free will. Thus, we see the Bible -- and the unfolding of human history -- as starting with God intensly involved in and affecting man's affairs, gradually, releasing his control, as we grow up. Still watching, perhaps even giving an occasional shove here and there, but leaving us, in this world, more and more to our own devices. Per His plan.