Our database of currently 414 national and naval flags from around the world includes mainly countries (e.g. 193 UN members + 2 observers), and partially recognized nations, as well as other independently governed bodies (i.e. subnational and unincorporated). 279 of these are "national" flags, ones representing the nation or body as a whole, and 135 being naval ensigns and jacks of many of these bodies.
The "national" flags used mostly follow a popularity trend. Typically civil ensigns are used if not official national flags. If the state flag is more of a standard, then that can be seen, too. "Unofficial" flags are often used for unincorporated bodies for them to be unique, and because they are often adopted by the local governing body.