The purpose can be to work, fight, blockade, escort and travel together. It can be on planetary bodies and in space.
A fleet consists of at least one capital ship such as a Battlecruiser or Carrier with various smaller vessels like combat, multipurpose ships and fighters. A warship such as the Farragut Battle Cruiser could be utilized by the commanding officer as a flagship.
A fleet is the largest formation in a navy. Formations can be used for better coordination during battles and training exercises. Capital ships are usually in the middle of the fleet surrounded by corvettes, combat ships and freighters. Fighters are throughout the fleet.