Cook himself, I believe, was a corpsman for a Marine Recon unit and fought in Vietnam, and the books read that way, although the Black Company is a medieval-style free company and instead of all the high-tech support Marine Recon gets the Company has their own section of sorcerers.
If you've ever wondered what a Vietnam-style counter-insurgency would look like in a sword & sorcery world, here it is. In the first novel, the Company is hired by the sorceress queen of an empire to root out and destroy a troublesome insurgency that seems to keep growing despite her own army's victories. Prophesies of the White Rose, a messianic figure, give many of the queen's subjects a religious fervor for the insurgency, and so the Company is tasked not only with fighting the insurgents but disproving the prophesies. There is some good military cloak-and-dagger work in that. Of course, the queen's own generals grow to hate the Company as she increasingly relies on it to do the job her native regiments don't seem to be able to accomplish, so the Company is always watching its back as well. It's a great story.
Now, back in the Rogue One thread we had a good discussion of heroes, anti-heroes, and the value of "ethical risk" in a story, to borrow MikeD's term. The Black Company begins on the other side of things: villains, anti-villains, and the imperative to maintain a reputation as an organization no one ever wants to go against. So what's the attraction? How can the reader sympathize with this band of knaves?
First, I have to say it's been years since I've read these books, so I'm just relating the impression they have left on me after all this time.
I think in part the reader can sympathize because Cook's world is morally ambiguous; there are no clear-cut good guys. In part, it is also because Cook has that magical power to make you believe his characters are real people. Sure, they work for whomever pays them, but the men of the Company fight and die for each other, they are courageous and cunning, and as I read their story I was proud of their victories and grieved for their losses.
They are all deeply flawed, but in their own way they are doing their best. To join the Company is to forsake everything else; enlistment is for life. You go where the Company goes, and the Company goes where the contracts are. Imagine the backgrounds of men who would willingly sign on that dotted line. No one has anything or anyone waiting for them back home, except maybe the sheriff. They have no family but each other, and they are fiercely loyal.
One of the things Cook does well is show the reader what it means to fight for the man next to you, even when the man next to you is a pain in the butt and a moral reprobate. There is also the pride of being the best, and of consistently taking on the toughest jobs and pulling them off, even when you might end up on the losing side of the war.
Finally, I would be remiss if I didn't mention that there are a couple of redemption stories. If anti-heroes run the edge and have to fear crossing over to become villains, some of the Company are anti-villains who run the other side of that edge and fear becoming heroes (something they don't believe in), but the light calls to them.