A flagship is the lead ship in a fleet of vessels, a designation given on account of being either the largest, fastest, newest, most heavily armed or, for publicity purposes, the best known. In military terms, it is a ship used by the commanding officer of a group of naval ships. The term originates from the custom of the commanding officer (usually, but not always, a flag officer) to fly a distinguishing flag.
Used in this way, "flagship" is fundamentally a temporary designation; the flagship is wherever the admiral's flag is being flown. However, admirals have always needed additional facilities; a meeting room large enough to hold all the captains of the fleet, and a place for the admiral's staff to make plans and draw up orders.
In the age of sailing ships, the flagship was typically a first-rate; the aft of one of the three decks would become the admiral's quarters and staff offices. This can be seen today on HMS Victory, the flagship of Admiral Nelson at the Battle of Trafalgar, now at Portsmouth, England. HMS Victory still serves the Royal Navy today as the ceremonial flagship of the Commander-in-Chief Naval Home Command[1] making her the oldest commissioned warship in service.
In the 20th century, ships became large enough that most types could accommodate commander and staff, and during World War II admirals would often prefer a faster ship over the largest one. Some larger ships may have a separate flag bridge for use by the admiral and his staff while the captain commanded from the main navigation bridge. Because its primary function is to coordinate a fleet, flagships are not necessarily more heavily armed or fortified than other ships. Increasing communications and computing requirements have resulted in the design of specialized command and control ships to serve as flagship.