Why do soldiers salute?
What is a salute? It is a gesture of respect to a person of superior rank. It is formalized, that is, it is done in a certain way every time.
Salutes of all kinds have existed in all periods of history and in all cultures. The form of salute has varied. In some cases it meant bowing, in others, it meant kneeling or lying on the ground, or various gestures of the hand and arm. The individual military salute that a soldier gives—raising the right hand to the forehead or to the hat brim or visor—was developed quite recently in history.
Until the end of the 18th century, the way junior officers saluted superiors and soldiers saluted officers was to doff the hat. In fact, civilians still do this as a gesture of respect. And this custom probably goes back to the days when a knight would raise his helmet's visor or uncover his head before a lord.
The change from taking off the hat to just raising the hand in a salute took place for a very practical reason. When soldiers fired their muskets, black powder would settle on their hands and make them very grimy. If they then had to use their grimy hands to take off their hats in a salute, it would ruin the hats. So at the end of the 18th century, the change was made to the hand salute.
An officer or soldier carrying a sword or saber at the shoulder, whether mounted or on foot, salutes by bringing the hilt to his mouth, then extending the point to the right and downward. This form of salute dates back to the Middle Ages when knights, in a religious gesture, kissed the hilts of their swords as symbolic of the cross of Christ. It was then a form of oath-taking.