In his commentary on 2 Samuel Fr. Barron hits on this very difficult question. With the help of Thomas Aquinas he seeks to nuance our understanding of this issue.
“Why should the Spirit of Yahweh have rushed upon David but not Saul, at least not to the same degree? Why, for that matter, did God favor Jacob over Esau? Why does John’s Gospel speak of a disciple of Jesus who was, in a unique sense, the ‘beloved’? . . . Thomas Aquinas broaches this thorny problem in question 23 of the Summa theologiae, which addresses predestination. . . . Aquinas contends that God does indeed love everyone (indeed every existing thing) in the measure that he wills each person (or thing) some good; nothing would have the good of existence unless God willed it, and love is nothing but willing the good of the other. But, he continues, this does not mean that God wills the same good for everyone and in the same way. Inasmuch, therefore, as he wills some the good of eternal life, he is said to love them more than those to whom he does not will that particular good. . . . What makes Aquinas’s treatment odd is that many of us think of love much more subjectively than objectively; that is, we consider the quality of the lover’s love rather than what the love produces. John Calvin, in the context of his discussion of predestination, makes the observation that God showers his love everywhere, but unequally: some people are more intelligent, more beautiful, more courageous than others; some plants are more fecund than others; some animals have greater strength and attractiveness than others; and so on. He insists, furthermore, that the God of the Bible is a choosing or electing God, which necessarily means that some are not chosen or elected: Israel and not the other nations, Jacob and not Esau, Abraham and not Lot, Jedediah and not Absalom. . . . But lest this analysis conduce toward a voluntarism that renders God’s judgment truly arbitrary, one must remember that on the biblical reading God’s elections are not so much for the sake of the elect but for the sake of those to whom the elected one has been sent. I do not know a single exception to the principle that any biblical figure who receives the grace of an encounter with God is, concomitantly, sent on mission. This is true of Noah, Abraham, Moses, Joshua, Gideon, Samuel, Isaiah, Jeremiah, Peter and Paul. Certainly God elects, but his election affords to a human being the deep privilege of participating in the process by which God is saving the whole of humanity. In other words, predestination and the love of predilection are not tantamount to God’s ‘playing favorites’ but rather functions of his desire that his lowly human creatures cooperate with him in the act of salvation. . . . In a certain sense, Solomon received a special privilege from Yahweh, but he was not, strictly speaking, loved for his own sake. Election always leads to mission.” (pp. 119-21)