Liberia has about 5.6 million people. It is not a major shipbuilding country. It doesn't have a giant domestic shipping industry.

Gif by wizartStudios on Giphy
It doesn't have thousands of shipowners waiting around Monrovia for their next vessel.
And yet its flag is attached to more than 6,200 vessels representing roughly 320 million gross tons about 18% of the world’s ocean-going fleet.
So here is the slightly ridiculous question: Why are shipowners around the world paying a West African country to put its little flag on ships that may never come anywhere near Liberia?
Because the flag on a ship is not decoration. It is a legal business decision.