At the end of Parshas Matos, we see Moshe Rabbenu commanding the Bnei Gad and Beni Ruven regarding there request to settle on land on the east side of the Yarden. He agrees but makes them promise to cross the Yarden and fight with the rest of the Bnei Yisroel to capture the land. Ve’Avar Lochem Chalutz Es HaYarden.
The Bal HaTurim explains that the word Chalutz has a second meaning here and refers to Chalitzah. The removal of the shoe a man does when Yivum is refused. Yivum occurs when a man dies childless - His wife must then marry a brother or perform Chalitza with him to sever that bond and then marry whomever she wants.
The Bal Haturim explains that if one goes out to battle in a war, one should write a Get, a divorce for his wife so that she will not have to resort to Yivum or Chalitzah should he die. Moshe required that here and this is what the words VeAvar Lahem Kol Chalutz means to tell us.
David HaMelach learned from that.
The Gemarah in Kesuvos (Daf tes amud beis) explains that according to R’ Shmuel Bar Nachmeni, Amar R’ Yochanan - Bat Sheva was not forbidden to David even though she was still apparently married to Uriah. This is because Beis David required all of his soldiers to write Gittin before going to battle. Rashi explains that this was done in case the soldier would die The Get would be valid from the time it was written. This is called a Get Al T’nai. A conditional Get.
In David’s case, Uriah the husband of Bat Sheva died in battle and was thus retroactively divorced.
However - If this practice was instituted to prevent Yibum or Chalitza, then if a man had had no brothers – or children - it would not be necessary. If he dies - his widow could marry whomever she wants. Tosphos and other Rishonim ask - if that’s the case, what is the point of requiring ‘All’ that go out to war to write a Get? Why the wording “All”?!
Tosephos and the Ramban explain that Rashi did not necessarily mean that a Get was written ‘in case of death’ but I case they do not return immediately from battle leaving doubt as to whether he died. Rashi used the word ‘die’ because typically when someone doesn’t return from battle its because he was killed. But the Get took place even when a husband is taken captive thus freeing her from any doubt.
So why don’t we do a Get Al T’nai today? That’s because of Rabbenu Tam and the Rashba. They explain that Rashi means that a get was actually –delivered- to Bat Sheva prior to battle and not just written Al T’Nai. This was done to prevent her from becoming an Agunah. The Navi reprimands David – not - for taking a married woman… but because this was done improperly by David since he did it in private thus preventing others from courting her. And in my own view this also created a Maaris Ayin situation since his Taking Bat Sheva would have appeared to be taking an Eishes Ish
The Ri M’Paris took from the words of Rabbenu Tam that the Get of a Shechiv Mira - someone who is in a terminal state of illness - should not be written Al T’nai because the fear of error on the part Sofrim an the details of such Gittin. So he Paskin’d that if a Shechiv Mera wants to prevent his wife from going through a Chalitza, he must give her a Get outright without a T’nai. If he recovers he an then re-marry her.
The Marsha point out that in his day a Get Shechiv Mera is given without any T’nai according to the Psak of the Ri MiParis. And indeed Uriah gave Bat Sheva an actual Get and she was a Penuiah - free of any marital bond.
Source: Torah L'Daas