The Battle of the Kegs is a ballad written by Francis Hopkinson dramatizing an attempted attack upon the British Fleet in the harbor of Philadelphia on January 6, 1778 during the American Revolutionary War.
The kegs themselves were made by Colonel Joseph Borden's cooperage to the specifications of Caleb Carman and designed by David Bushnell, an inventor and graduate of Yale College. They were filled with gunpowder and released to float down the Delaware River. It was hoped that they would contact British warships along the riverfront and explode as river mines. As the floating mines moved downriver, however, few of them contacted the ships of the British navy. The British had hauled their ships into positions that protected them from floating river ice, and as a result of this precaution the ships also avoided the exploding kegs. The operation did not achieve strategic military results, and the British fleet was little damaged. The only casualties were two curious young boys who were killed by a mine/keg and alerting the British. The attack was ineffectual. 
Even so, the attack generated a panic on the waterfront, and throughout the entire day the sound of cannon was present in the port as the navy desperately attempted to destroy the kegs before they could find a target. Similarly there sounds of musketry from the shore as the soldiers were ordered to fire upon any piece of flotsam in the water, with not one piece of wood being overlooked. The defense operation continued for several days longer until the British were confident the anchorage was safe.
While the episode did not inflict any casualties on the British forces, the Red Coats response was the source of much amusement to the Americans, and provided an opportunity to uplift morale. The event was dramatized in ballads and a series of mocking newspaper articles, including most prominently in the New Jersey gazette. The ballad sarcastically praises the "courage" of the British occupation force during emotional scene on the Philadelphia riverfront.
On August 13, 1777, a Bushnell floating mine/keg sank a small (captured) schooner/tender to , in Black Point Bay, New London, CT killing three sailors and saving 1 man.
The Ballad of the Kegs was meant to signal the indefatigable nature of the American rebel army, which had been driven out of Philadelphia and at the time of this operation was encamped under miserable conditions at Valley Forge. By creating a defiant song, the Americans hoped to signal that they did not propose to give up. 
References.
 ;templatestyles src="Reflist/styles.css" / ;