The system was initially developed as the Sierra Club grading system in the 1930s to rate hikes and climbs in the Sierra Nevada range. Previously, hikes and climbs were described relative to others ("harder than X, but easier than Y"), but this made it difficult for those who hadn't done the other hikes or climbs to compare climbs, so the numerical grading system was developed to codify climbs on a single scale.
Currently, according to the climbing textbook Mountaineering: The Freedom of the Hills, the system divides all hikes and climbs into five classes:
The original Sierra Club grading system also had a Class 6, for artificial, or aid climbing. This sort of climbing uses ropes and other equipment for progress (e.g. climbing a rope up a sheer face with no holds). Class 6 is no longer widely used, however, and artificial climbs today are graded on a separate scale from A0 through A5.
Note that the exact definition of the classes is somewhat controversial.
The increasing technical difficulty of Class 5 climbs led to the same relative-grading problem that had caused the initial development of the system; as a result, Class 5 was subdivided in the 1950s. Initially it was based on ten climbs of Tahquitz Rock in Idyllwild, California, and ranged from "the Trough" at 5.0, a relatively modest technical climb, to "the Open Book" at 5.9, considered at the time the most difficult unaided climb humanly possible. This system was developed by members of the Rock Climbing Section of the Angeles Chapter of the Sierra Club.
Ratings between indoor gym climbing, sport climbing and traditional climbing can also vary quite a bit, depending on location and history. For example, a 5.8 climb in a New Jersey gym can correspond to a 5.10c climb in a California gym. A 5.6 climb in a California gym may correspond to a 4th class climb at Yosemite.
Advances in techniques and equipment since then have led to harder climbs being completed. The first such climb was given the rating 5.10; the second the rating 5.11. It was later determined that the 5.11 climb was much harder than 5.10, leaving many climbs of varying difficulty bunched up at 5.10. To solve this, the scale has been further subdivided above the 5.9 mark with a-d suffixes. As of 2005, several climbs are widely agreed to be at the 5.15a difficulty. Akira, by Fred Rouhling, has been claimed as a 9b (French grade) which translates to 5.15b. Chilam Balam by Bernabé Fernández was graded as 9b+/5.15c. Both are controversial.
See SACIN for tables comparing 16 different climbing grading systems and a list of the hardest climbs