God foreknew the remnant of Israel who would not bow to Baal, and those in Paul's generation who would believe in his son Jesus Christ and be led to salvation by grace. God called his children,his faithful, even before they were born.
Let's look at verse 7. It reminds us of the multitude of Israelites who set upon the journey into the promised land, out of Egypt. They all went, not one of them stayed behind. They all obeyed God's instruction to eat the unleavened bread and smear the blood of the sacrificial lamb on their doors so the angel of death would pass them over. At the beginning of their journey they were all chosen and that they all believed in God and obeyed him. It is in the course of their journey that God separated the chaff from the grain, the unbelieving and faithless from the ones who truly believed. Joshua and Caleb represent the remnant of that generation of Israelites.
We may all belong to Christian churches, worship God regularly, say our prayers together with our families, and do many other things as per the teachings of our elders and ancestors. We may all set out in faith when we begin our journeys into Christiandom and the sonship of God the Father, but it is only the remnant, those who truly persist in their faith despite the various trials and persecutions they endure, or despite the possession of good health and of great earthly riches which could both be distracting and lead one astray, who will be saved by his grace.