This was written around the mid 20th century by an author who (I think) was also known for sci-fi, but this was about a real person and (more or less) based on real events.
The protagonist was a Confederate leader in the US civil war. He was not a secessionist, but lived in a state that had voted to secede from the Union and felt that the Union's position in the war was anti-democratic, so he was willing to fight for his state.
After hearing that one of the main Union leaders had decided to focus all his energy on the front lines, he said something like "if he won't look after his back, then I will" and spent the war harassing the Union army's supply lines.
He was a kind of freelancer, making money by looting the enemy instead of being employed/commissioned, which allowed him greater freedom. I'm pretty sure it said his talent for strategy led to him being offered a commission later in the war, but he turned it down because his men would earn less as regular soldiers so he'd have more trouble finding recruits.
There was a summary saying he'd caused the Union army to divert a significant amount of effort away from the front, and a brief epilogue about what he did after the war.
I read it on Project Gutenberg, but having forgotten the names of the author, book and main character I haven't managed to find it again.