Three families, one palette
The first family is the tricolours: three equal bands, vertical after the French model or horizontal after the Dutch. The Netherlands, France, Russia, Thailand, Costa Rica and many others belong here, and the ordering of the bands is usually the only way to tell them apart at a glance.
The second is the Pan-Slavic group. When the Prague Slavic Congress of 1848 looked for shared colours, it took red, white and blue from the Russian flag, which is why Serbia, Slovakia, Slovenia, Croatia and the Czech Republic all draw on the same three colours in different arrangements.
The third is the Union Jack family: flags carrying the British flag in the canton, or derived from it. Australia, New Zealand, Fiji, Tuvalu and a long list of territories sit in this group, and it is the reason the palette reaches so far into the Pacific and the Caribbean.