grain is cheap and convenient and until very recently a high grain content was the only thing that enabled manufacturers to even make dry dog food. conventional processing methods require a certain amount of starch for the kibble to keep its shape and not crumble apart, and the cheapest source for that starch are grains. other starch works too (see kibbles that utilize e.g. potato or sweet potato), but is overall more expensive.
grains as we know them today are a "man made" thing, developed by selective breeding of cereal grasses. there are no wild varieties that bear grains as large and rich in starch as cultivated types.
so it's not even natural for herbivores like horses, cattle etc. to eat large amounts of grain. they would not find it anywhere in their natural habitat.
all that being said, if the individual dog tolerates grain well there is no harm in including it, such as for example in a home prepared diet.
but in commercial dry foods you are looking at a situation where a food can contain as little as 15% meat (or byproduct) ingredients and the rest are grains and fillers - definitely not something that is natural for a carnivorous animal.