[3] The biblical command, in the case of the Canaanite inhabitants, was to exterminate them and to annex their territory,[8] whereas others who made peace with Israel could be enslaved and forced to pay tribute.
[5][10] However, if there were a case whereby the nation of Israel had been attacked by an enemy for any reason, that would be tantamount to a battle waged in a religious cause ("religious war"), in which case it is the bounden duty of all in Israel to fight and resist the enemy, hence: a mandatory war (or battle waged in duty bound).
[11][15][a] [When you go out to war against your enemies, and see horses and chariots and an army larger than your own, you shall not be afraid of them, for the Lord your God is with you, who brought you up out of the land of Egypt, etc.
The writing [in Mishnah Soṭah] speaks about the voluntary war (milḥemet ha-reshūt) [fought at Israel's own discretion].
Although certain persons were permitted by Deuteronomy, chapter 20, to leave the field before a battle began, this was allowed, according to rabbinical opinion, only in case of a voluntary war.
[25][26] However, if they had come to take away lives, even if it were only a doubtful case, the people of Israel are permitted to go out to battle against them and they desecrate the Sabbath on their account, in order to rescue them.
], it was explained that even in the remaining cities and towns of Israel where the enemy had launched an attack, it is a Jew's bounden duty to go out to battle on behalf of his threatened countrymen, in order to assist them,[28] and when they have eventually rescued their fellow countrymen, they are allowed to return to their place [on the Sabbath-day] with their own armaments in hand, seeing that if they were not allowed to do so they would refrain from assisting their brethren in future conflicts.
[25][26] An ethical question was raised in the early 20th-century about whether or not one is permitted to give-up his own life in order to avert danger to the Jewish people as a whole, both in war and non-war situations, in which the answer posited by Abraham Isaac Kook (1865–1935) and by Shlomo Zalman Pines [he] (1874–1954) was an unequivocal yes, although each man gave different reasons for this allowance.