The practice of draping the casket with the national flag
This custom began during the Napoleonic Wars (1796-1815). The dead were covered with flags and carried from the field of battle on a caisson. When the U.S. flag covers the casket, it is placed so the union blue field is at the head and over the left shoulder. It is not placed in the grave and is not allowed to touch the ground.
Flags for military funerals
Flags are provided for burial services of service members and veterans. The flag for one who dies on active duty is provided by one's branch of service. Flags for other veterans are provided by the Department of Veterans Affairs. The flag is presented to the next of kin at the end of the funeral. If there is no next of kin present, the flag may be presented to another family representative or a close friend of the Veteran.
The practice of firing cannon salutes
The custom of firing cannon salutes originated in the British Navy. When a cannon was fired, it partially disarmed the ship. Therefore, firing a cannon in salute symbolizes respect and trust.
The practice of firing three rifle volleys over the grave
Military funeral honors may include the firing of three rifle volleys over the grave during interment. The president of the United States, as commander-in-chief of the country's armed forces, is authorized this honor.
The firing of three volleys over the grave of a fallen warrior has its origin in the old custom of halting the fighting to remove the dead from the battlefield.
Once the dead were removed, three-musket volleys were fired as a signal that the battle could resume. A firing party of seven service members traditionally fires the volleys. The fact that a firing party might consist of seven service members firing three volleys does not constitute a 21-gun salute.
It has also been suggested that the custom may have deeper roots. In Roman customs, mourners would cast dirt on the coffin three times and this constituted a burial. They would also call the deceased by name three times and upon departure say farewell three times.
All personal salutes may be traced to the prevailing use in earlier days to ensure that the saluter placed himself in an unarmed position. Salute by gunfire is a most-ancient ceremony. The British compelled weaker nations to make the first salute, but in time international practice compelled "Gun for Gun" in the principle of an equality of nations.
In the earliest days, seven guns was a recognized British National Salute. Those early regulations stated that, although a ship could fire only seven guns, the forts could fire for honors three shots to one shot afloat. In that day powder of sodium nitrate was easier to keep on shore than at sea. In time, when the quality of gun powder improved by the use of potassium nitrate, the sea salute was made equal to the shore salute - 21 guns as the highest national honor. Although for a period of time, monarchies received more gun than republics, eventually republics claimed equality. Beginning in our colonial period, the United States fired one shot for each state in the Union. This was continued until 1841 when it was reduced to 21 from 26. Although it was in use for more than 30 years, the 21-gun salute was not formally adopted until Aug. 18, 1875. This was at the suggestion of the British, who proposed a “Gun for Gun Return” to their own 21-gun salute. Today, the 21-gun salute is an internationally recognized honor rendered to heads-of-state.
"Taps" is an American call, composed by the Union Army's Brig. Gen. Daniel Butterfield while in camp at Harrison's Landing, Va., in 1862. Butterfield wrote the call to replace the earlier "Tattoo" (lights out), which he thought too formal. The call soon became known as "Taps," because it was often tapped out on a drum in the absence of a bugler. Before the year was out, sounding Taps became the practice in Northern and Southern camps. The call was officially adopted by the U.S. Army in 1874. Col. James A. Moss, in his Officer's Manual first published in 1911, gives this account of the initial use of Taps at a military funeral: "During the Peninsular Campaign in 1862, a soldier of Tidball's Battery A of the 2nd Artillery was buried at a time when the battery occupied an advanced position concealed in the woods. It was unsafe to fire the customary three volleys over the grave, on account of the proximity of the enemy, and it occurred to Capt. Tidball that the sounding of Taps would be the most appropriate ceremony that could be substituted. The custom, thus originated, was taken up throughout the Army of the Potomac and finally confirmed by orders."
Information gathered from the manual Drill and Ceremonies, July 03, HQ DA, FM 3-21.5