Historically a vessel on the high seas flew the flag of its
country of origin. In the 20th century, such countries as the US
imposed laws on shipping companies such as paying fair wages and
maintaining safe working conditions that ship owners were callous
enough to ignore. They could do that by registering their vessels
in such countries as Liberia or Panama, which had no such
restrictions on their greed. They flew the flag of the country of
registry, and it was called a flag of convenience. Most of the
merchant ships of the world flew flags of only about three
countries like that.