The tricorne hat appeared as a result of the evolution of the broad-brim round hat first used by Spanish soldiers in Flanders (today the northern part of Belgium) during the 17th century.

By pledging (binding) the brims, a triangular shape was formed. This shape was favored by Spanish soldiers. As they were standing at arms their muskets could be held at their right or left shoulders, without hitting the hat brim.

War started between France and Spain in 1667 over the Spanish Netherlands, and during the subsequent struggle, the tricorne use then spread to the French armies. The style was brought back to France, where its usage spread to the French population and the royal court of King Louis XIV.

The tricorne ended up being the fashionable attire in both civilian and military uniforms throughout the 18th century. In the United States, only the first 5 Presidents from George Wasington to James Monroe, wore this style of hat. President Monroe earned the nickname 'The Last Cocked Hat'.

More Info: en.wikipedia.org