If God foreknew that some would believe in Jesus and others would reject Him, why did He create people whom He knew would reject Him? Why not simply create people whom He knew would repent and believe in Jesus?
The answer to that question is a little more difficult to understand, but not impossible.
First, we must understand that God created us with free wills. That is, all of us have the privilege of deciding for ourselves whether or not we will serve God. Our decisions to obey or disobey, repent or not repent, are not predetermined by God. They are our choice.
This being so, every one of us must be tested. God, of course, foreknew what we would do, but we had to do something at some point in time in order for Him to foreknow it.
By way of example, God knows the outcome of every football game before it is played, but there must be football games that are played with outcomes if God is going to foreknow the outcomes. God doesn’t (and can’t) foreknow the outcomes of football games that are never played because there are no outcomes to foreknow.
Similarly, God can only foreknow the decisions of free moral agents if those free moral agents are given an opportunity to make decisions and do make them. They must be tested. And that is why God didn’t (and couldn’t) create only people whom He foreknew would repent and believe in Jesus.