Pretty much every regiment and Confederate state and county, etc. had their own battle flag. The rebels were often starving and ill with typhoid or malaria when they surrendered. The Union generals did great strategic harm to the Confederate war effort through sabotage of railways and bridges, and got a lot of help from local southerners, black and white, who were tired of the terror and deprivation caused by the war.
The infamous Stars and Bars flag, plus all the Confederate state flags, were banned as treasonous after the war ended. The flags were re-instated, at least as major Confederate elements, to all the contemporary southern state flags as a political rebellion against Federal desegregation laws passed during the Civil Rights movement of the '50's and '60's. My own state's flag, currently flying over the state capitol in Tallahassee, Florida, is in fact a reincarnation of Florida's Confederate flag - the red cross bars are the particular Confederate element - and it was adopted by the Florida legislature during the early sixties to protest civil rights laws.
Just about every state flag in the former Confederate South today still has some element in it's flag that was put in during the Civil Rights movement era as a protest. They all need to be corrected back to their non-treasonous, non-Confederate designs. The flags express a sneaky, chicken-shit bigotry amongst certain politicians and their factions, who keep "explaining" the flags away as just a form of honoring ancestors and such. Bullshit. They are flags that flip a "fuck you" finger at every non-white citizen in this country.