Admiral is a navy rank given to an officer who commands a fleet of ships. The word comes from from a corruption of the arabic term amir-al-bahr (Commander of the sea).
In Star Wars
An admiral is a flag rank above Line-captain and Commodore. Due to the size of the Imperial fleet, several classes of admiral exist that each represent different ranks. Admirals do not command a single ship, their responsibilities lie entirely at the fleet level and above. Admirals draw up invasion plans, organize supply transfers, and otherwise tend to keep themselves occupied at the higher levels of fleet function.
In Star Trek
In the Federation Starfleet, admirals appear to be largely desk officers, directly commanding groups of ships only in times of war due to the largely dispersed nature of the fleet in peacetime. Oddly enough, the supposed Federation flagship Enterprise is almost never occupied by a Flag officer of any rank (unless his name is James T. Kirk).