A flagship is the ship used by the officer who commanded a group of naval ships. The term comes from the custom of the commanding officer to fly a special flag to show he was present.
Used in this way, "flagship" is normally a temporary name; the flagship is wherever the officer is flying his flag. However, admirals have always needed a special place; 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.