But if they're CG, you also have to do it without imprisoning them, right? Or something?
There's no reason chaotic good beings can't, or won't, take prisoners.
The difference between lawful and chaotic in this instance is where the authority to imprison comes from. In a lawful society, it comes from duly-constituted institutions, such as king's magistrates; in a chaotic society, it's vested in the judgement of a respected individual like an elder or a chief.
Look, you're NG, you find someone breaking into your house at night, and you have a gun . . .
I'm not going to interpret the rules of a game in terms of real-world moral and ethical considerations. That way lies madness.
All else being equal, a good-aligned watchman shouts, "Who goes there?" and attempts to take a miscreant prisoner if possible. A neutral-aligned watchman does what's expedient. An evil-aligned watchman may shoot first and ask questions later, or never. All of this gets shaded by the influence of law and chaos on the watchman's alignment.
I think a Good being is relatively beholden to take prisoners alive, when feasible. But I don't see how respecting life does not mean you don't take it.
Good-aligned beings take life in the protection of life. That doesn't mean they do it proscriptively, or preemptively, or indiscriminately, however.
Individual Good creatures may indeed avoid life-taking, or prisoner-taking, or any other thing they may consider particularly abhorrent.
The taking of prisoners isn't affected by alignment - the treatment of prisoners is.
Perhaps a magic-hating race thinks there is nothing more profane than casting sleep on a being who is willing to engage in honorable conflict.
That's a social more which can be found in any alignment on the law-chaos axis; it has nothing to do with good or evil.
If a Good being thought a kingdom would be better off, overall, after having been conquered, they might very well conquer it. There's an example right there of how Good beings can come into conflict.
If the good-aligned ruler of a kingdom felt that gaining control over another largely good-aligned kingdom would improve the quality of life for the latter, he has a number of other means at his disposal, such as politicking the dynastic succession, like backing a rival claimant or marrying into the dynasty.
Good-aligned beings act with restraint because of their respect for life. Evil beings do not show this same restraint.
And I'm done threadjacking; the last word is yours to take.