the 'confederate flag' that many know of today is an invention of the 20th century, post-war. as you can guess/see, it's very similar to the northern virginia army which was commanded by robert e lee
the 'confederate flag' for decades after the civil war was a very solemn object and symbol, as far as i know it was only taken out during times of memorial or remembrance. later on/further into the early-mid 1900s, the flag was also used (especially in WW2) by the US army for some units (which i believe just adds to the historical value even more) then, come the 1950's, there was a flag 'fad' (hell, iirc the fad reached europe too i think?) the 'confederate flag' became a symbol of general rebellion in our/the US south's pop culture, this was essentially rebellion over any and everything, without a really set political purpose as much as i can tell. it wasn't really until the civil rights movements in the 60's that the flag began to become a symbol of reaction. the kool kids klub would occasionally trot out the 'confederate flag' as if it were their own but that wasn't really mainstream by any means
as for the cause of the american civil war that i'm seeing brought up occasionally here, that's an entirely different topic. slavery was definitely a big part of it, don't get me wrong, but there's still more depth to it