God is able see the future and make decisions based upon this. When passages in the Bible speak of the elect, these people were chosen by God because He knew beforehand that they would choose Him.
An alternative view is that God, being all knowing, is able to determine every decision a person will make and thus He knows exactly what a person will do and the choices he will make. In either case, God does not thrust salvation upon anyone but rather elects those who will choose Him through their own free will.
Foreknowledge as it relates to election is an Arminian doctrine. Rather than unconditionally electing people for salvation, God is able to determine what a person’s choices will be and elects from eternity past those He knows will choose to follow Him.
See election for a third view that is neither Arminian or Calvinistic in doctrine. This view attempts to balance the sovereignty of God with the free will of man.