All salutes are signals of voluntary submission.
Early warriors simply placed their weapons on the ground.
But when guns came along, the ritual of firing off or emptying cannons was done to illustrate to approaching foreign dignitaries that they had nothing to fear.
In 1688, the Royal Navy regulated the number of guns to be used in saluting different ranks.
For a prime minister, nineteen guns should be used, but for royalty or heads of state, the salute should be done with twenty-one guns.