I'll try to give you a recap as best I can. It was kinda confusing.
There were 21 flags. Whoever captured the last flag won immunity.
You could take 1-2 or 3 flags per tribe, per turn. It was all strategy. Somewhere along the lines, SJ screwed themselves over, leaving 4 flags. Since you could only take 3 flags, they lost. It didn't matter if they only took one or two flags, CG would have been able to take the very last flag with their turn.
In a surprisingly touching move, when there were 4 flags, Sook Jai decided to take 3 flags.. leaving the 1 flag out there for Chuya Gahn. Penny congratulated Clay in a very sincere moment. Then, all of Chuya Gahn went out to symbolically take the last flag. I admit it, I got choked up.
Sook Jai really wanted that immunity. There is no way that loss was easy for them.