This depended a lot on the time period and warring states.
Take, for example, the Battle of Flodden Fields in 1513. The Scots King, James IV, was killed on the field, as were the majority of the Scots nobility. Most of the Scots court was killed at Flodden, and it was England's greatest triumph over the Scots in a century. The nobility was decimated, and it took nearly a generation for their sons to replace them, and the court of Mary, Queen of Scots looked quite different from that of her grandfather and father, even though they were only thirty years separated.
Contrast this with the Battle of Lewes, in 1264. Henry III of England initially attacked from strength, but was defeated and was captured by his barons. As regicide was not considered acceptable at this point in history, the Barons never considered executing Henry, but forced him to sign over many of his powers to the leader of the Barons, Simon de Montfort, who was later referred to as an "uncrowned king."
Edward II and Edward V were both killed in prison, and Richard II was likely starved to death in prison as well, while Richard III was killed on the field of battle. However, since there was belief in the divine right of Kings, a defeated King was not killed outright by his opponents, at least during the medieval period - John and Henry III were both forced to relinquish some of their kingly powers when they were defeated in battle, but execution never crossed the mind of their captors.
Knights and nobles were similarly treated, but it was not unheard of for nobles to be killed on the field. Outright execution of nobles was, again, frowned upon - Piers Gaveston, one of Edward II's close advisors, was hunted down and killed by other nobles because they believed he earned too much of the King's patronage. This caused the King to fly into a rage, and it was not for some time that he came to an accord with the barons, even pardoning them for the crime. Executing nobility was not taken lightly.