You are not missing something. Legally a sovereign nation contracts a private company to act on their behalf as their Flag State Authority. Nothing wrong with that, in legal terms at least.
In reality private companies are “buying” the right to use a flag and “sell” that flag to shipowners who find it convenient to use a flag other than the national flag of their domicile. The reasons can be many, but usually it is nothing illegal.
Some (especially European) flag states has found that they are missing out and have established a Second (or Open) Register, where the requirement of domicile and nationality of crews have been eased to attract shipowners to register their ships, thus maintaining a fleet under their flag.
Also nothing wrong, or illegal with that, as long as they maintain the same standard as for the first (or National) register. The main difference is crew costs, since they are allowed to pay local wages for crews from lower cost countries, (As long as the pay is at least ITF approved rates)
Tax has very little to do with it, since most countries do not tax their shipping companies, regardless of which flag their ships fly. Same with safety and ship standard. They still have to comply with IMO and ILO rules of operation and the ships have to be built and maintained to Class rules to obtain insurance.
Any hope that US owners who now use FOCs will become patriotic and register under US flag is pipe dreams, as long as USA insist on being “different” from everybody else.
It is not only the difference in wages, but all the other things that goes with it.
(I’m NOT talking about standards of ships, safety rules, or crew training standard and quality)
BTW; From your questioning here I get a feeling you know a lot more about this subject then you want to let on.(??)