Chivalry refers to the medieval institution of knighthood, and especially the ideals and that were associated with it, or have become associated with it through literature. It was often also associated with ideals of knightly virtues, honour and of courtly love.
Chivalry was in essence a warrior code propagated by the Church. The Church intended to make the mounted soldiers of the Middle Ages into Christian knights who would protect society instead of ravage it.
The word comes ultimately from the Latin caballus, or "horse". The French chevalier and the English cavalier derive their names from the same word. The intention, in all these cases, is to distinguish the aristocratic knight on horseback from the peasant infantryman walking with his pike and the artilleryman dragging his vulgar machinery.
In war, the chivalrous knight was brave in battle, loyal to his king and God, and willing to sacrifice himself. Towards his fellow Christians and countrymen, the knight was to be merciful, humble, and courteous. Towards ladies above all, the knight was to be gracious and gentle. The idealized relationship between knight and lady was that of courtly love.
In a contemporary context, chivalry denotes courteous behaviour, especially towards women.
Chivalry is also the name of a fictional ghost town in Montana in the book Max the Mighty.