Definition: of the finest quality
A1 was first used to mean "having the highest qualifications" in reference to commercial ships. The term referred to the highest possible rating in the system instituted prior to 1800 by that very famous insurer of almost everything, Lloyd's of London. (To date, Lloyd's has insured food critic Egon Ronay's taste buds, soccer star David Beckham's legs, and business magnate Richard Branson's Virgin Galactic private spaceship.) Lloyd's registry of ships explains the A1 rating in this way:
The character A denotes New Ships, or Ships Renewed or Restored. The Stores of Vessels are designated by the figures 1 and 2; 1 signifying that the Vessel is well and sufficiently found.
Since shipping was of such great importance to the British economy in the 18th and 19th centuries, and since Lloyd's was so well known, the rating system became part of the public consciousness. It was soon common to express one's admiration for a vessel by referring to it as an "A1 ship."
From there, A1 acquired the figurative sense "of the finest quality" or "first-rate," and was applied to anything regarded as an outstanding example of its kind. The earliest known use of A1 in this sense appeared in Charles Dickens' novel The Pickwick Papers, in which Sam Waller says, "He must be a first-rater," and Mr. Roker replies, "A1."