This came in small pieces, so you might think 'grain' was meant to imply that the stuff looked like seed, but in fact, this meaning of grain comes from the French word for texture or fibre, but while to dye in grain, or to ingrain was originally to dye with the fast kermes colour, it soon came to mean dyeing with any fast dye, while an ingrained ass or an ingrained fool was an incurable dolt.
Some timbers, of course, are harder to work, because there are two grains not one, so the timber is cross-grained, a word that applies particularly well to elm wood, according to Nehemiah Grew, but it also applies to people who are difficult to work with.
Then again, cloth can have a grain as well. If it is a large grain, or grosgrain, like the picture on the left, it is called grogram in English. One Admiral Edward Vernon was in the habit of wearing a grogram coat, and became known as 'Old Grog'.
When he introduced watered rum into the Royal Navy, it was also called Old Grog, and then just grog. Rum, of course, is from sugar from the sugar cane. Any other drink except wine, and we would be back to grain again.
Not that it matters, because I can get there another way.
Vernon's first command was the HMS Rye. I win, again!