Wherein you greatly rejoice, though now for a little while, if need be, you have been put to grief in various trials,
Paul tells us in Ephesians 1:0 that "we were chosen in Him before the foundation of the world" ( Ephesians 1:4 ). Here election is according to the foreknowledge of God.