Flags will be flying around the United States this July 4th, as America celebrates its Independence Day. But you can see plenty of red, white and blue banners any other day of the year as well. Since the terrorist attacks of September 11, 2001, growing numbers of people in the United States have been hanging flags by their front doors, sticking flag decals on their cars, and wearing flag T-shirts, neckties and lapel pins. On June 22 of this year, the U.S. House of Representatives endorsed a constitutional amendment that would allow legal bans on flag desecration.

It is all part of a long love affair that author Marc Leepson explores in his new book (published by Thomas Dunne Books). Mr. Leepson says the question at the heart of his book was inspired by a U.S. pilot taken prisoner during the Vietnam War. The pilot made a tiny American flag out of red, white and blue threads, and his fellow prisoners saluted it every morning. "He was caught doing it one day, and he was tortured," says Mr. Leepson. "And almost the first thing he did after he got better was make another one of these flags, and they saluted that for the rest of the time, clandestinely. And I got to thinking what was it about this piece of cloth that would cause people to literally put their life on the line?"

New Book Traces History of American Flag

The United States flag has inspired not only individual acts of courage, but poems, paintings and songs, including John Philip Sousa's famous march . Marc Leepson says that while countries around the world revere their flags, Americans seem to have a special relationship to their national banner. "I couldn't find another country that has their children pledge allegiance to the flag, and has since 1892, or has as their national anthem an ode to the American flag, ," says the author, a Vietnam veteran who frequently writes on historical subjects.

New Book Traces History of American Flag

"We have had non-profit groups that have promoted proper use of the flag since the 1880s. There are several things I postulate. One is that we are a nation of immigrants, and the flag is something that immigrants can rally around as theirs. We don't have a monarchy here, and I think perhaps there's an innate need among people to have a symbol of their country."

New Book Traces History of American Flag

But surprisingly little is known about the origins of that familiar symbol, says Marc Leepson. Historians are not sure who made the first one -- despite a popular tradition that it was a Philadelphia seamstress named Betsy Ross. Nor are they certain why it consists of white stars set on a blue background, flanked by red and white stripes.

Most believe the colors were inspired by the British flag. As for the stars and stripes, Marc Leepson says stars and heraldry have always stood for trying to attain greatness. "The other thing is that nearly all the Founding Fathers were Masons," he notes, "and stars have a very strong place in Masonic iconography. The stripes? We don't have a clue. The Dutch owned part of the United States in the beginning and the Dutch flag has three broad stripes, but we just don't know where they came from."

In 1777, the Continental Congress issued a resolution calling for a national banner of red, white and blue, with 13 stripes and 13 stars. More stars were added as states joined the Union, until the flag assumed its current form -- 13 stripes and 50 stars.

Decisive moments in the later history of the flag often came at times of military conflict. During the War of 1812 with Britain, a Washington lawyer named Francis Scott Key went to nearby Baltimore to help negotiate the exchange of a prisoner named Dr. William Beanes. "They had dinner and drinks in the cabin of the commander of the British fleet," Marc Leepson explains, "and they amicably settled it and let Dr. Beanes go. But the British commander told Key he couldn't leave because they were going to bombard Fort McHenry, so he said, 'Please stay in this sloop in the harbor.'"

During the 4 days of fighting that followed, Francis Scott Key began writing a poem describing what he called "the broad stripes and bright stars," still flying at dawn, after a night of heavy fighting. A musical version of eventually became America's national anthem.

The American Civil War marked another turning point for the Stars and Stripes. Until Southern troops fired on Fort Sumter in 1861, Marc Leepson says flags were mostly confined to government buildings and military installations. "When the American flag came down at Fort Sumter, it went up in New York and Philadelphia and Boston and other cities in the North," Mr. Leepson says. "People put flags in their hats, on their horses. In many ways, in the North the editorials and politicians framed the fight as a fight over the flag."