Loads, Grains, and Bullets
With modern firearms the term "grains" refers to weight. The term itself is a throwback to the black powder era. On a box of ammunition cartridges the term "grains" describes the weight (mass) of the bullet. In the most simplified terms, lighter bullets (lower grains number) are accurate at short to medium range while heavy bullets (higher grains number) are better at retaining energy at longer distances.
If you purchase a box of a .30-06 rifle cartridges you will note that the load is marked on the box described by grains.
Illustration: 220 grain bullet weight
The box of cartridges in the illustration above from the 1950's describes a 220 grain soft point bullet. This refers to the weight of the bullet and not how much gunpowder is in the cartridge case. The original M1906 .30-06 cartridge consisted of a 150 grain jacketed bullet. After WWI the weight of the bullet was increased to 173 grain for military use. Contemporary .30-06 bullet weights range from 110 to 220 grains.
When speaking in terms of gun powder, the amount of powder, also expressed in grains, has a lot to do with the type of powder used. There's a variety of modern smokeless powder types with various burn rates for various application types. Faster burning powder achieves high velocities with less powder while with slower burning powder the charge, or powder load in grains, may be increased. It is generally very dangerous to load a cartridge case to full capacity with any modern smokeless powder, especially the faster burning types.
Ammo manufacturers readily share the bullet weight in grains in their advertising, but rarely give details about what type of powder is being used and the powder weight in grains. Different ammo manufacturers use different types of powder and different powder charges. Although ammo with a heavier bullet weight will tend to have a hotter powder load (more powder or faster burning) this is not always necessarily true.
Remember, you can achieve a more powerful powder load by using a faster burning powder, or increasing the amount of powder in the load. Using near or at the maximum powder load that is safe to fire in a gun is called "loading hot." Hot loads are more powerful, which causes more recoil (kick) and the bullet will strike with more energy. However, ammunition hot will shorten the life of your firearm in increase your risk of injury.
Factory Loads
Ammunition manufacturers tend to use proprietary gunpowder types of their "own special recipe." Powder weight, in grains, is completely meaningless if you do not know the powder type being used. Manufacturers will rarely release specifications on the burn rate of their powder and the amount of powder they use in a particular cartridge. All ammunition manufacturers load ammunition to SAAMI (Sporting Arms and Ammunition Manufacturers' Institute) specifications.
Remember, powder capacity is not the same as powder load. A .30-06 rifle cartridge has a case capacity of 68.2 grains, however, loading to that capacity may result in destruction of your rifle and serious injury when using most common smokeless powder types. It could be accomplished as a hot load with a slow burning powder.
Nomenclature
Consider a 30-30 rifle cartridge, which has been around since the early days of smokeless powder. It was designed for smokeless powder and introduced in 1895. The name designation has significance in that it refers to having a 30 caliber bullet on 30 grains of smokeless powder. The 30-40 Kraig military cartridge comes from the same naming convention, a 30 caliber bullet on 40 grains of smokeless powder. This naming convention is no longer used.
With the 38 Winchester CF, formerly known as the 38-40, the two first numbers (.38) indicate the caliber and the (.40) indicate grains of gunpowder with which it was loaded originally. Such nomenclature is not standardized and you should not expect to encounter all naming conventions based on the same idea.
History
The unit of measurement called "grain" dates back to medieval Europe. The average mass of a single grain of wheat was the standard for the grain unit of mass. The term "troy grain" was based on the average mass of a single grain of barley.
The grain is used to measure the mass of bullets, gunpowder, smokeless powder, and preformed gold foil; it is the measure used by the balances used in handloading; bullets are measured in increments of one grain, gunpowder in increments of 0.1 grains.
Black powder has a low energy density compared to modern "smokeless" powders, and thus to achieve high energy loadings, large amounts of black powder are needed with heavy projectiles.