Military funerals are filled with traditions, but none as ancient as firing a volley over the deceased.
During the Napoleonic Wars, hostilities were ceased to clear the dead from the battlefield.
When finished, the detail would fire three shots into the air as a signal that they were ready to resume the fight.