Medieval thinking on war, including that of Thomas Aquinas, was based on St Augustine's theory of the just war as laid out in On the City of God (5th century AD).
St. Augustine saw war as a means to deal with sin. War was a judicial action in which the people fighting were, in one way or another, righting a wrong. As Agustine put it originally, "justa bella ulciscuntur injurias" (just wars avenge injuries) also means that the those who who wages wage war play the role of God's scourge and that this action, inspired by love, is beneficial even for him against whom it is directed. The Augustinian attitude was that you have to show your love any way you can and war was simply a large scale application of the death penalty to people who had earned it.
In more practical terms, a king might say to another that "your dynasty is wicked and I will invade you and wipe you out to save your people from your wickedness." What they are really saying is that "your lands are in disarray and I'm going to attack you because you're not strong enough to defend yourself."
According to Augustine, you can only take up the sword if you are the injured party, or if you perceive an injustice that needs redressing (such as the occupation of the Holy Land by the infidels). Thus, to this day, an aggressor almost always tries to come up with some injury to himself to justify his own invasion.
In the fourteenth century, Christian writers like John Gower and Philippe de Mezieres were not impressed by the dynastic justifications for war offered by England and France. The warring parties even tried to recast their actions as a crusade, so that they could be morally certain of waging a proper war. They were not concerned with how the war was practised but whether it was in fact ever right in the first place. This is why the moral legitimacy of the sovereign who declares war was so important to the theorists in the Middle Ages and later. Shakespeare in his play Henry V still had this attitude.
Medieval war extended beyond the battlefield. Assassination was widely practiced and this was not felt to be a dastardly act. As St Augustine put it, "all homicide is not murder."
There were certain exceptions to the law against killing, made by the authority of God himself. There were some whose killing God orders, either by a law, or by an express command to a particular person at a particular time who speaks with Gods authority. The pope, for example. One who owes a duty of obedience to the giver of the command does not himself "kill," he is an instrument, a sword in Gods hand. For this reason the commandment forbidding killing was not broken by those who have waged war on the authority of God. This standard also applied for those who have imposed the death-penalty on criminals when representing the authority of the state, recognized by the church as the just and most reasonable source of power. The Old Testament offered many examples of this use of Gods authority. When Abraham was ready to kill his own son, so far from being blamed for cruelty, he was praised for his devotion. It was not a criminal act, but one of obedience. In an other example, one is justified in asking whether Jeptha is to be regarded as obeying a command of God in killing his daughter, when he had vowed to sacrifice to God the first thing he met when returning victorious from battle (Judges 11 29ff). And when Samson destroyed himself, with his enemies, by the bringing down the building, this can only be excused on the ground that the Spirit, which performed miracles through him, secretly ordered him to do so. With the exception of these killings prescribed generally by a just law, or specially commanded by God himself (the source of justice) anyone who kills a human being, whether by himself or anyone else, is involved in a charge of murder. That was how St Agustine put it, and this interpretation was widely accepted throughout the Medieval period.
St Thomas Aquinas, the 13th century authority on theology, gave several criteria for a Just War:
1- The war must be to "right a wrong"
2- The war must be winnable. Fighting hopelessly, even against an evil despot,
is not justified. Of course, which struggle is winnable and which is not is something best judged with hindsight.
3- The suffering caused, or thought likely to be caused, by the war is going
to be less than the suffering caused by leaving whatever evil you are trying
to correct, like a despot on the throne, in place. You want to wage the war
"efficiently" in terms of human suffering.
The third point was oft quoted to justify assassination. In the 14th century, the king was
the state. Kill the evil noble and you eliminate his evil rule. If the king or duke was an eveil fellow, "killing the tyrant" by any means neccessary was considered spiritually superior to waging war and killing thousands of soldiers and civilians. But this ran up against the establishment of class consciousness within the nobility. Seeing themselves as a better sort of people, the nobles found it convenient to treat each other charitably in combat. Thus there was the prevalence of offering quarter and taking ransom instead of the opponents life. Assassination was not unknown, but it was frowned apon. While the theologians might condone one noble killing another, the aristocrats were content to pay ransom and fight again another day.
The nobles fighting in the Hundred Years War did so with little regard to the damage they caused. This was particularly true with the English. Depopulation of towns and villages in France was noted in a lot of the sources. Petrarch visited Paris in the 1360s and reported wolves running in the streets and whole surrounding villages empty. That probably was caused in part by the plague, plus the medieval tendency to exaggerate and blame all earthly misfortune on human sin and God's displeasure (God does things in a big way). Yet the war between the English and French king was fought in such a way that everyone suffered except the two kings who started. According to Medieval thinking, one of these two kings was "wicked" (each accused the other of being the bad guy), but neither of them suffered much for it.
During most of the Medieval period, war between the international nobility was insulated from the brutalising effects of total war. It was something between a game and a career path, where people went to war for reasons of personal profit and social advancement, rather than abstract devotion to king and country. In 1421, for example, two English squires, John Winter and Nicholas Molyneux, entered into a solemn agreement to fight together in France and to pool their winnings (ie, ransoms) and invest them at home. These fellows were definitly not going off to do Gods work.
Dispite the theological admonitions against it, the middle ages had an enormous propensity to accept cruelty and barbarity as a fact of life. Thus you see figures like Sir John Hawkwood, who probably would be at home in Bosnia or Somalia today as a warlord, being praised in the 15th century as a chivalrous and noble knight who deserved to be remembered alongside Edward III, the Black Prince, and Sir John Knollys (another mercenary commander and self-made man). Du Guesclin, who served with mercenary captains in Spain before going on to become Constable of France, was praised as a pious and gallant knight.
There was a chivalrous side to all this, but not in terms of sparing the innocents. For example, Poton de Xaintrailles, a professional soldier and mercenary, thought nothing amiss when he took a break from combat to participate in a great tournament/pageant staged by Rene of Anjou in 1446. This was not hypocrisy, but chivalry as it was actually practiced and an essential part of a military career. Attending tournaments with your enemies added social acceptability and class solidarity to the profession of arms.
There were exceptions. The Wars of the Roses was pretty cruel, but it was an internal dynastic war. Those types of wars are always cruel and very hard on participants with royal blood or royal aspirations. The French/Burgundian wars of the same period were similar in tone.
What has come down to us via the most literate and persuasive Medieval writers is not entirely accurate. Froissart, for example, genuinely believed in chivalry and all the pretty stuff that went along with it. So he tended to gloss over the unpleasant stuff. Like massacres of peasants, rape and pillage, torturing of priests so's they'd reveal where the silver was hidden, etc.