When the Confederate States of America seceded from the Union, they didn’t have the population or industrial capacity of their Northern neighbor. But in the half-decade or so their rebellion survived, the men in gray faced perhaps a greater existential crisis: flag envy.

Try as they might, those who thought black people should legally be held in servitude just couldn’t agree on a standard. The first flag they chose, some said, looked too much like the Stars and Stripes. The second flag they chose, some said, looked too much like a flag of surrender. And the flag most identified with the South’s cause today — the one flying on the grounds of South Carolina’s state capitol that’s drawn fire after a mass shooting in Charleston — wasn’t even an official Confederate flag.

The Confederate flag on display, from 1938 to today

WASHINGTON, DC- JUNE 21: A confederate flag reflected in the window of a gift shop that sells them in Seligman, Arizona. The Confederate flag (aka the Rebel Flag) can be seen in plain view in almost any part of the United States although sightings are more common in the South. Michael S. Williamson/The Washington Post)

To be clear: The Rebel flag wasn’t a peripheral question for the South. When the provisional congress of the Confederacy met in February 1861, one of the banner issues was the banner. Surprisingly, some didn’t want to ditch Old Glory.

“Let the Yankees keep their ridiculous tune of ‘Yankee Doodle,’ but by all that is sacred, do not let them monopolize the stars and stripes,” one Confederate sympathizer told South Carolina’s William Porcher Miles, the man in charge of the congress’s flag committee, as recounted in “Flag: An American Biography.”

Miles disagreed with such thinking. Out with the old, he said, and in with the new.

“In inaugurating a new government we can not with any propriety, or without encountering very obvious practical difficulties, retain the flag of the Government from which we have withdrawn, “ Miles wrote. “It is idle to talk of ‘keeping’ the flag of the United States when we have voluntarily seceded from them.”

But, not one to stymie the birth of a new nation, Miles acquiesced to the committee’s decision to approve the first official Confederate flag: what’s known as the Stars and Bars.

But, as Miles anticipated, a symbol of a rebellion that paid tribute to its alleged oppressor didn’t really work out. There wasn’t just a problem with confusion on the battlefield; there was a problem with self-esteem.

“Every body wants a new Confederate flag,” George Bagby, editor of the Southern Literary Messenger, wrote in January 1862. “The present one is universally hated. It resembles the Yankee flag and that is enough to make it unutterably detestable.”

As discontent with the Stars and Bars brewed, Miles stumbled into the history books. His own design for the Confederate flag was never officially adopted by the insurgent would-be nation. However, taken up by the Confederate army — not to mention “The Dukes of Hazzard” and alleged Charleston shooter Dylann Storm Roof — the pattern became the enduring symbol of its cause.

This was a most holy piece of cloth, it seemed.

“Soldiers: Your mothers, your wives, and your sisters have made it,” Confederate Gen. P.G.T. Beauregard told his troops in 1861. “… It can never be surrendered, save to your unspeakable dishonor, and with its consequences fraught with immeasurable evil. Under its untarnished folds beat back the invader, and find nationality, everlasting immunity from an atrocious despotism, and honor and renown for yourselves – or death.”

Believe it or not, though critics said his flag looked like “a pair of suspenders,” Miles made the cross diagonal as a nod to religious diversity.

“It avoided the religious objection about the cross (from the Jews & many Protestant sects), because it did not stand out so conspicuously as if the cross had been placed upright thus,” he wrote.

But even as Johnny Reb marched to battle under this informal banner, there was a movement afoot to change the official flag. Though some insist the South seceded for states’ rights, the Confederacy’s second choice would forever explicitly link its cause to white power.

In 1863, as the Confederate flag was discussed at the Rebel congress in Richmond, a racist newspaper editor — William Tappan Thompson of the Savannah Morning News — weighed in. His idea: Put the battle flag on an expanded field of white to make “the white man’s flag.”

“As a people, we are fighting to maintain the heaven ordained supremacy of the white man over the inferior or colored race; a white flag would thus be emblematic,” Thompson wrote. He added in another article: “As a national emblem, it is significant of our higher cause, the cause of a superior race, and a higher civilization contending against ignorance, infidelity, and barbarism.”

The Confederates were enthusiastic, and adopted the new flag — the Stainless Banner in May 1863.

Thompson dismissed objections that the flag looked too much like a flag of truce or would get dirty.

“We have always observed that the white stripes have stood the battle and the breeze as well and looked as fresh and bright as the red,” he wrote.

This flag, incidentally, flies on the grounds of the state capitol in Montgomery, Ala., today.

Before the Confederacy folded, however, it would change the flag one more time. The Stainless Banner, it turned out, did look too much like a flag of truce and did get dirty. As one Confederate major put it, the flag was “very easily soiled from its excessive whiteness.”

Two months before the end of the war, the South switched to what would be called the Blood-Stained Banner: the Stainless Banner with a red stripe.

Though short-lived, the Blood-Stained Banner couldn’t be used to say uncle. At Appomattox Court House, where Robert E. Lee surrendered, a tea towel was used as a flag of truce.

Three official flags in five years, at least two directly related to racism: This is part of the confused history to which the Confederate flag flying in Columbia pays tribute.

“People look at it as honoring their heritage and the ancestors who fought in the war,” state Rep. James Burns (R-Greenville), who wants the Confederate flag to stay in Columbia, told the Charleston Post and Courier. “They have a place in history and people want that observation made, not placed in a dark closet and hidden away somewhere.”

More about the Confederate flag:

Here's what the GOP presidential hopefuls have to say about the Confederate flag in South Carolina. (Gillian Brockell/The Washington Post)