What are they?
A flag state is the location of where a commercial ship is registered or licensed with.
What do they do?
While the primary responsibility of ship operators and owners is the safe operation of their ships and the safety and welfare of their crews, flag states have the legal authority and responsibility to enforce regulations upon vessels that are registered under its flag, such as those relating to inspection, certification, safety, and pollution.
For example, if a ship owner or operator chooses to fly the popular Panamanian flag, he/she must meet the standards set by the Panamanian Registry administration. The flag state will arrange for quality inspections, certification, and the issuance of safety and pollution prevention documents to ensure that national and international regulations are being met. It is for that reason that a nation’s role as a flag state is often seen as the first line of defense against potentially unsafe or environmentally damaging ship operations.
Ship owners and operators have the right to choose their flag state. To attract owners and operators, flag states may offer incentives, such as cheap registration fees, low or no taxes and discounts to fleet registration. Flag states are not just coastal countries, since the Flag Right Declaration of 1921, it has been recognised that all states, including land locked countries, have the right to be used as a flag state.
Shipping Industry Flag State Performance Table 2017/18 - International Chamber of Shipping
Flag State implementation - International Maritime Organisation (IMO)