Well its always been a very crux issue at the heart of Christianity - because in that religion there is just an extreme line between heaven and hell, and because its your choices that put you there. Its a pretty unique idea found only in Christianity by the way. So, if you behave badly (sin) you are knowingly going against god. If god is omniscient - and that's pretty central to the Judao/Christian conception of god - then if god knows your going to sin, and allows it to happen, then weather your going to hell, or heaven, is predestined.
You sin, because you always sin, you've always sinned. The moment is always just that way.
However, that's a real poor way to try to control and dictate people behavior (the end goal of all religions). You want people to work to do good (like giving to the church) and that is the notion of free will.
You can't have both. Though that is claim.
Of course the religious argue that though God is Omniscient god CHOOSES not to know. Which is right about where I lost my faith.