The numbers are known as the "Sheldon Scale"; it's simply a different way of writing down the grade, using numbers rather than letters. "40" means the same as "EF": extremely fine.
It's origin: in a book about early American cents written in 1949, W.H. Sheldon discerned a formula between condition and price. His book only listed prices for "basal state" (worn flat) coins; prices for coins in better condition could be estimated by taking the basal state price and multiplying it by the Sheldon number. Thus, a coin in EF-40 condition was worth twice as much as a coin in VF-20 condition, and 40 times as much as a worn flat coin of the same type. The system has evolved slightly since then, too; basal sate "BS-1" is now called poor "PO-1".
Here is the Scale as it is now used by PCGS; other grading companies in north America all use a similar scale, though each has their own modifications.
Of course, the relationship between price and condition is no longer quite so simple, even for the early US copper cents the scale was designed for use with. A coin in MS-67 is worth far, far more than a coin in MS-60. Yet the numbers are retained, out of tradition.
The British grading company CGS UK couldn't care less about the Sheldon Scale or other coin grading traditions the North Americans observe; their numerical grades use a 100 point scale.
I don't really know why numbers are so important in grading coins these days. Maybe they like the way it makes coin grading look all scientific and statistical, rather that the dark art that it actually is.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis