In Tzahal, the Hannibal Directive has been practiced for a long time, whether officially or unofficially. This means that if a soldier is kidnapped, the army acts against the kidnappers in every way possible in order to thwart the kidnapping. This includes shooting at them, even though there is a high risk of wounding or killing the kidnapped soldier (Hannibal, by the way, was a Carthaginian military commander who opted to poison himself rather than fall into the hands of the Romans).
During Operation Protective Edge, Lt. Eitan entered a Hamas tunnel with incredible courage in order to save his kidnapped officer. He gave an order that if they identified something, they should shoot, knowing full well that they could wound or kill the officer. Tzahal also heavily bombed the area in order to prevent the kidnappers from fleeing.
This is obviously a very difficult directive emotionally. Various Rabbis and writers had expressed their reservations regarding its use (see "Hannibal Directive according to Halachah" [Hebrew] by Rav Eleazar Goldstein, Techumim #31 p. 157 and Jewish, Military Ethics [Hebrew] p. 222). Nonetheless, Tzahal is correct regarding this issue. The soldier's life is not less important than other people's lives. On the contrary, it is extremely important. After all, he displays self-sacrifice day and night. It is extremely difficult for the father and mother of a kidnapped soldier to hear about the Hannibal directive, but we must not be confused: it is impossible to run a country based on the emotions of a parent's heart. A country must be run on a systematic intellect. And regarding this issue, Tzahal is correct.
In his major article on the authority of the King and the reigning authority, Maran Ha-Rav Kook explains that the laws of Pikuach Nefesh are different for an individual than for a Nation (Shut Mishpat Cohain #144, pp. 315-316). For the ruling authority, a kidnapped civilian or soldier is much more dangerous than one who is killed. A person who is killed is a tragedy, but a person who is kidnapped is a tragedy which breaks the national morale as well as the fighting spirit.
In general, it is forbidden to negotiate with terrorists. If it is nonetheless done, however, we must apply the Talmudic principle of "captives may not be ransomed for more than their value" (Gittin 45a). For example, the State of Israel redeemed Shmuel Rosenwaser for one terrorist, based on the traditional mathematical equation of 1=1. In our times, however, we trade 10, 100 and even 1000 terrorists for a kidnapped Jew. As is known, half of released terrorists return to being involved in murdering Jews. As a result, a kidnapping not only breaks the national morale, the resulting release of terrorists endangers the rest of the citizens.
It is true that every soldier is cherished by us, but the essence of serving in the army overrides Pikuach Nefesh. In the army, a soldier is always in danger. An officer sometimes leads his soldiers into extremely difficult missions, and sometimes even missions in which there is a real possibility than none will return alive (See Minchat Chinuch #425. Shut Meishiv Milchama of Ha-Rav Ha-Gaon Shlomo Goren Volume 3, pp. 273-274). Tzahal is even willing to endanger its soldiers in order to free a kidnapped Jew (See Shut Yabia Omer Volume 10 Choshen Mishpat #6 regarding Operation Yonatan - the Raid on Entebee).
And see the article of Ha-Rav Ha-Gaon Shlomo Goren in his book Torat Ha-Shabbat Ve-Ha-Moed (pp. 391-404) which justifies the bravery of the Jews of Masada, who committed suicide in order not to break the national morale. Rav Goren also justifies King Shaul's falling on his sword for the same reason, based on the Meharshal's opinion, that this is what he was required to do. He also rules there that a soldier who fears that under torture he will reveal military secrets that will endanger his fellow soldiers is obligated to commit suicide. In our time, this is no longer the case, but the principle remains.
While the Netziv has a unique opinion that there is no principle of "Do not murder" in war (Ha-Emek Davar Bereshit 9:5. And see Devarim 20:8), Ha-Rav Shlomo Yosef Zevin writes that this is a big Chiddush (Le-Or Ha-Halachah pp. 17-18).
This is the guiding principle in the army: we do not make decisions solely based on their immediate results, but based on systematic calculation and long-term effects. It is true that the basic Halachah of "Pikuach Nefesh" is judged according to the "here and now", but our Sages already established that regarding redeeming captives we are not always able to solve a current problem on account of future implications, because of Tikkun Olam - "The good order of the world" (Gittin ibid).