This is an EXTREMELY controversial question as the text has been used by all kinds of extreme groups justifying (in many cases) rather bizarre positions. Thus, we need to proceed rather delicately.
Foreknowledge here does not necessarily involve an exclusive knowledge by God about who He decides to save. It only implies God's foreknowledge in the sense of planning ahead of time how to implement salvation. One can see this in the text because it is addressed to the exiles of the dispersion in Asia minor; if this were an exclusive arrangement it would exclude everyone else and mean that only those exiles would be sanctified by the Spirit. Further, God's saving work is specifically addressed to all people not just those that will ultimately accept.
- John 12:32, “I [Jesus] … will draw all people to myself.”
- Acts 17:30, “God … commands all people everywhere to repent.”
- Rom 3:23, 24, “… for all have sinned … and all are freely forgiven...”
- Rom 5:15, “But the free gift is not like the offense. For if by the one man’s [Adam’s] offense many died, much more the grace of God and the gift by the grace of the one Man, Jesus Christ, abounded to the many.” [Note the same word, “many” applies to all people.]
- Rom 5:18, “Therefore, as through one man’s offense judgment came to all people, resulting in condemnation, even so through one Man’s righteous act the free gift came to all people, resulting in justification of life.”
- 2 Cor 5:14, “…we are convinced that one died for all, and therefore all died.”
- 1 Tim 2:3, 4, “For this is good and acceptable in the sight of God our Saviour, who desires all men to be saved and to come to the knowledge of the truth.”
- 1 Tim 2:6, “[Jesus Christ] gave Himself as a ransom for all people.”
- Titus 2:11, “For the grace of God appeared bringing salvation to all people.”
- 2 Peter 3:9, “The Lord is not slow in keeping his promise, as some understand slowness. He is patient with you, not wanting anyone to perish, but everyone to come to repentance.”
- 1 John 2:2, “He Himself [Jesus] is the propitiation for our sins, and not for ours [Christians to whom John writes] only but also for the whole world.”
According to BDAG, the verb "hagiazo" means (of things) "set aside something or make it suitable for ritual purposes consecrate or dedicate". For persons, "include a person in the inner circle of what is holy, in both cultic and moral associations of the word, consecrate, dedicate, sanctify." Thus when a person is sanctified, the person becomes a "saint" in the sense of being "separated to God" (W E Vine). Thus, many of the epistles in the NT are addressed to "the saints" ("hargioi") (eg, Eph 1:1, 2 Cor 1:1, etc.). This did not make them perfect or revered (far from it) but simply dedicated to God. See 1 Cor 6:11.
In fact, most of the occurrences of the this verb "hagiazo" discuss a past, completed act, and by means in addition to the Holy Spirit, eg, John 17:17, 19, Acts 20:32) by faith in Jesus (Acts 26:18, 1 Cor 1:2, 2 Tim 2:21, Heb 10:10, 29 ) through the Holy Spirit (Rom 15:16, 1 Cor 6:11). Note that these verbs are past tense, and discuss sanctification as a completed act (see also Heb 13:12).
Thus, when a person is converted and becomes set apart for Christ (ie, becomes a Christian) the person immediately becomes a “saint” or “holy one” (Rom 1:7, 1 Cor 1:2, Phil 1:1, etc.). Sometimes these saints are called “elect” or “chosen” (Matt 24:22, 24, 31, Mark 13:20, 22, 27, Rom 11:7, 1 Tim 5:21, 2 Tim 2:10, Tit 1:1, 1 Peter 1:1), or the pure or purified (Matt 5:8; 2 Cor 11:2, Titus 1:15, 1 Peter 1:22). That is, as far as the Christian is concerned, sanctification (in the Biblical sense) occurs at conversion as a decision to follow Jesus, and occurs at some point in (past) time.
The Holy Spirit, as shown above, is an integral part of this effect on a person that turns them from unconverted to converted to become a saint, that is, sanctified, Rom 15:16, 1 Cor 6:11, 1 Peter 1:2. See also Heb 2:11, 10:14 where Jesus is also involved.
There is an interesting side-note about the effect of this sanctification. In Acts 11:26 it appears that the title "Christian" was not invented by Christians but conferred by the outside observing public because of their dedication to Christ and their obvious Christian deportment. That is, their dedication (sanctification) to Christ made them imitators of Christ (Eph 5:1, John 16:13, 14).
The Christian must be born of the Spirit (John 3:5) by receiving the gift of the Spirit (Acts 2:38) and walk by the Spirit (Gal 5:25, John 6:63, Phil 3:3, John 4:24). In fact the whole life of Christian is to put aside the “psychical” mind and live by the Spirit (1 Cor 2:14, 1 Cor 15:44-46, Gal 5:17, Jude 19, John 6:63, 1 Peter 3:18).