A flag state is a country that has jurisdiction and control over a vessel that is flying its flag. In other words, it is the country whose laws and regulations apply to a vessel that is registered with that country.
The flag state is responsible for issuing and enforcing regulations for the construction, operation, and safety of the vessel, as well as for ensuring that the vessel is manned and operated in compliance with international standards and regulations. The flag state is also responsible for issuing certificates and documents that are required for the vessel to operate, such as a certificate of registry, a certificate of classification, and a certificate of competency for the crew.
In order to fly the flag of a particular country, a vessel must be registered with that country and must meet the requirements for registration and operation set forth by that country's maritime laws and regulations. The flag state has the authority to detain or fine a vessel that is not in compliance with these requirements.
In the context of international maritime law, the flag state is considered to have jurisdiction over the vessel, regardless of where the vessel is located or where the crew is from. This means that the laws and regulations of the flag state apply to the vessel and its crew, even when the vessel is operating in the territorial waters of another country.