Our Gemara on Amud Beis discusses Shaul Hemelech’s introduction to David:
דְּאָמַר קְרָא: ״וְכִרְאוֹת שָׁאוּל אֶת דָּוִד יוֹצֵא לִקְרַאת הַפְּלִשְׁתִּי אָמַר אֶל אַבְנֵר שַׂר הַצָּבָא בֶּן מִי זֶה הַנַּעַר אַבְנֵר וַיֹּאמֶר אַבְנֵר חֵי נַפְשְׁךָ הַמֶּלֶךְ אִם יָדָעְתִּי״. וְלָא יְדַע לֵיהּ? וְהָכְתִיב: ״וַיֶּאֱהָבֵהוּ מְאֹד וַיְהִי לוֹ נוֹשֵׂא כֵּלִים״! אֶלָּא אַאֲבוּהּ קָא מְשַׁאֵיל.
The Gemara asks: From where are these matters derived that female Ammonites and Moabites are permitted immediately? Rabbi Yoḥanan said: As the verse states: “And when Saul saw David go forth against the Philistine, he said to Abner, the captain of the host: Abner, whose son is this youth? And Abner said: As your soul lives, O king, I cannot tell” (I Samuel 17:55). This verse is puzzling: Did Saul really not recognize him? But isn’t it previously written: “And David came to Saul, and stood before him; and he loved him greatly; and he became his armor-bearer” (I Samuel 16:21)? Rather, it must be that he was asking about David’s father.
וְאָבִיו לָא יְדַע לֵיהּ? וְהָכְתִיב: ״וְהָאִישׁ בִּימֵי שָׁאוּל זָקֵן בָּא בַאֲנָשִׁים״, וְאָמַר רַב, וְאִיתֵּימָא רַבִּי אַבָּא: זֶה יִשַׁי אֲבִי דָוִד, שֶׁנִּכְנַס בְּאוּכְלוּסָא וְיָצָא בְּאוּכְלוּסָא!
The Gemara is still puzzled by this verse: And did Saul not recognize David’s father? But isn’t it written with regard to Jesse, David’s father: “And the man in the days of Saul was old, and came among men” (I Samuel 17:12), and Rav, and some say Rabbi Abba, said: This is referring to Jesse, father of David, who always entered with multitudes [ukhlusa] and left with multitudes. As he was clearly a man of importance, everyone must have known who he was.
Bereishis Rabbah (60:3) discusses this series of verses in an interesting manner:
Four people asked of God something that was inappropriately relying on miracles. Three were granted their request, while the fourth was not. Eliezer the servant of Avraham, Kalev, Shaul and Yiftach. We all know the biblical story of Eliezer, who asked God that the first maiden who comes to the well be the one who is chosen for Isaac (Bereishis 24:13-14). Kalev promised his daughter to whomever would capture Kiryas Sefer (Shoftim 1:13). Shaul promised his daughter to whomever would smite Goliath (I Shmuel 17:12) and fortunately it was David, who was a person of esteemed lineage fit for a king, as the verses in our Gemara attest. Yiftach dedicated to God whoever would come out of his home upon his successful return from battle. Unfortunately, it was his daughter, and she had to remain consecrated to God her whole life, and possibly even a human sacrifice, depending on how the commentaries read the verses (Shoftim 11:31-34).
Why did the first three people people merit a successful outcome and not Yiftach, since all of the requests were considered as inappropriately expectant of a miracle? We might just say, the people asking and about whom they were asking had greater merit. The commentary of Yefe Toar on the Midrash offers a different explanation. Kalev and Shaul were dealing with communal matters such as victory in war and conquests, so they could rely on the merit of the entire Jewish people. Similarly, Eliezer was relying on Abraham's immense merit. But what was Yiftach relying on?
I would like to offer another peshat. The first three examples had to do with marriage, Rivka, Kalev’s daughter and Shaul’s daughter. We have a tradition that marriage partners are especially chosen by providence over other concerns (see first daf in Gemara Sotah,). Therefore, even though not so appropriate, the requests were granted. On the other hand, though Yiftach’s intentions may have been devotional to God, and perhaps he thought a fat bullock would come out of the corral, it did not end so well. Unfortunately, as it turns out, it was his daughter. In matters not pertaining to marriage, there is less providence.