ALL that the Father gives is within the age of grace where His Spirit goes forth to draw all of mankind. As Romans 1:20 says that all are without excuse. By His foreknowledge the elect are those He has forseen to be in the Book of Life.
Salvation was given, is given, and will be given, unto all who become saved on exactly the same basis regardless of timeframe, that is, that Christ was designated Saviour before the foundation of the world - there was/is no other way to salvation but through Christ's grace and faith. Do you see "was ordained before the foundation of the world"?
[1Pe 1:19-20 KJV]
19 But
with the precious blood of Christ, as of a lamb without blemish and without spot:
20 Who verily
was foreordained before the foundation of the world, but was manifest in these last times for you,
God does not draw all mankind but only those whom He draws are those that He has obligated Himself to save, but we know that not everyone will be saved, ergo, it must be that not everyone becomes drawn nor saved. Do you see the "and I will raise him up at the last day"? That is the final act of the drawing and of salvation, but it pertains to those, and only those, who are drawn that will be of it.
[Jhn 6:44 KJV] 44 No man can come to me, except the
Father which hath sent me
draw him:
and I will raise him up at the last day.
The elect are those specifically chosen to salvation by God. For God to foresee and choose the elect based upon His anticipation of (their) yet to come actions and choices as you imply, would mean that God's foreknowledge was of the "what", not of the "who" - but election was of "who", not the "what". Do you see the "unto obedience" below? It does not say "because of obedience" but "unto obedience", meaning that those whom God chose were chosen UNTO obedience through the "sanctification of the Spirit" and the "sprinkling of the blood of Jesus Christ", and not chosen because God's expectation OF their obedience or behavior - God makes them obedient.
[1Pe 1:2 KJV] 2
Elect according to the foreknowledge of God the Father,
through sanctification of the Spirit, unto obedience and sprinkling of the blood of Jesus Christ: Grace unto you, and peace, be multiplied.
Whoever is an invitation to all. So why do some not accept His invite?
No, "whosoever" is NOT an invitation to all - it means only the "who" that it was intended to be for, so, all do not become drawn because it was intended for all; that is, only His elect were those intended and drawn.
ohn 3:16 ESV
16 “For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life.
God wishes that none shall persish so why doesn't God elect all? God could do that as it says it is His desire but there must be a barrier even He to some capacity leaves in place. The free will of mankind.
That verse could by itself be a standalone thread. Suffice it to say (for now), that belief in Him is given as a fruit of the Spirit from spiritual rebirth, which rebirth, comes with salvation. True belief comes not of man but of God.
The "barrier" is in mankind's sin, which sin, Adam, Eve and Satan caused. That God chose to save anyone,
given no one deserves salvation, is a testament to His mercy and grace. God placed Himself under obligation only to save those He desired to save, since He, Himself, alone made payment in full for that sin - a sin which we all commit. It is/was God's divine prerogative and good pleasure to save whomever He so chose, and we, as the guilty, cannot demand explanation from Him as to those choices. Instead, we should just be thankful that anyone becomes saved, and that He did not choose to punish mankind in its entirety which we would richly deserve.
[Rom 5:19 KJV] 19 For
as by one man's disobedience many were made sinners, so by the
obedience of one shall many be made righteous.
In the below, notice how Paul characterizes himself. He says of himself, that, "I am chief", not that "I was chief". In spite of him being so, God, nevertheless, chose Paul unto salvation.
[1Ti 1:15 KJV] 15 This [is] a faithful saying, and worthy of all acceptation, that Christ Jesus came into the world to
save sinners; of whom I am chief.
2 Peter 3:9 ESV
The Lord is not slow to fulfill his promise as some count slowness, but is patient toward you, not wishing that any should perish, but that all should reach repentance.
The keys to that verse are, (with your translation above) the "toward you" and the "any". To understand them, we must first find out who the "you" and "any" were that Paul was addressing. Paul explains this in two ways: first, in the preceding verse (3:8), we see that he characterized them as of the "beloved" - only the elect and the saved are the beloved of God; second, in the salutation of the book, (1:1 &3) confirming this, we are informed that it is addressed to those who have obtained "like precious faith", again, the elect/saved and not intended to everyone. Also notice that their faith (1:1), was obtained, not of themselves, but "through the righteousness of our God and Saviour Jesus Christ", who gave unto them "all things".
[2Pe 3:8-9 KJV]
8 But,
beloved, be not ignorant of this one thing, that one day [is] with the Lord as a thousand years, and a thousand years as one day. 9 The Lord is not slack concerning his promise, as some men count slackness; but is longsuffering to us-ward, not willing that any should perish, but that all should come to repentance.
[2Pe 1:1, 3 KJV] 1 Simon Peter, a servant and an apostle of Jesus Christ,
to them that have obtained like precious faith with us through the righteousness of God and our Saviour Jesus Christ: ...
3 According as his divine power hath
given unto
us all things that [pertain] unto life and godliness, through the knowledge of him that hath called us to glory and virtue:
So, what I am trying to convey, that it is Christ alone who is Saviour in all possible ways, and as such, He alone
must be the one who also saves in all ways. Man is not, and cannot, even to the slightest degree, contribute to his own salvation - it must totally and completely be from God as a gift through His mercy and grace.