early 14c., "a small, hard seed," especially of one of the cereal plants, also as a collective singular, "seed of wheat and allied grasses used as food;" also "something resembling grain; a hard particle of other substances" (salt, sand, later gunpowder, etc.), from Old French grain, grein (12c.) "seed, grain; particle, drop; berry; grain as a unit of weight," from Latin granum "seed, a grain, small kernel," from PIE root *gre-no- "grain." From late 14c. as "a species of cereal plant." In the U.S., where corn has a specialized sense, it is the general word (used of wheat, rye, oats, barley, etc.).
Figuratively, "the smallest possible quantity," from late 14c. From early 15c. in English as the smallest unit of weight (originally the weight of a plump, dry grain of wheat or barley from the middle of the ear). From late 14c as "roughness of surface; a roughness as of grains." In reference to wood, "quality due to the character or arrangement of its fibers," 1560s; hence, against the grain (1650), a metaphor from carpentry: cutting across the fibers of the wood is more difficult than cutting along them.
Earliest sense of the word in English was "scarlet dye made from insects" (early 13c.), a sense also in the Old French collateral form graine; see kermes for the evolution of this sense, which was frequent in Middle English; also compare engrain. In Middle English grain also could mean "seed of flowers; pip of an apple, grape, etc.; a berry, legume, nut." Grain alcohol attested by 1854.