Historically, flags were used to impart information at sea.
Today, flags remain an important communication device and serve as a symbol of national identity. Under the Law of the Sea Convention 1982, every ship must have a nationality and fly a national flag of a state. A courtesy flag is flown by a visiting ship in foreign waters as a token of respect.
It is often smaller than the ship's national flag, the biggest flag on board.