In war, a victor gives no quarter (or takes no prisoners) when the victor shows no clemency or mercy and refuses to spare the life of a vanquished opponent in return for their unconditional surrender. In some circumstances, the opposing forces would signal their intention to give no quarter by using a red flag; however, the use of a red flag to signal no quarter does not appear to have been universal among combatants.
Under the modern laws of war, "it is especially forbidden ... to declare that no quarter will be given". This was established under Article 23(d) of the 1907 Hague Convention IV - The Laws and Customs of War on Land.
Since a judgment on the law relating to war crimes and crimes against humanity at the Nuremberg Trials in October 1946, the 1907 Hague Convention, including the explicit prohibition against declaring that no quarter will be given, is considered to be part of the customary laws of war and binding on all parties in an international armed conflict.
The term may originate from an order by the commander of a victorious army that they "will not quarter (house)" captured enemy combatants. Therefore, none can be taken prisoner and all enemy combatants must be killed. A second derivation, given equal prominence in the Oxford English Dictionary (OED), is that quarter (n.17) can mean "Relations with, or conduct towards, another" as in Shakespeare Oth. II. iii. 180, "Friends all..In Quarter, and in termes like Bride, and Groome." So "no quarter" may also mean refusal to enter into an agreement (relations) with an enemy attempting to surrender. The OED mentions a third possible derivation but says "The assertion of De Brieux (1672 Origines..de plusieurs façons de parler, 16) that it arose in an agreement between the Dutch and Spaniards, by which the ransom of an officer or private was to be a quarter of his pay, is at variance with the constant sense of the phrases give and receive quarter."
... giving no quarter can be construed that have the same meaning as taking no prisoners.