Gas is largely created via intestinal bacteria (though some can be released by the food itself, and some can be a result of carbonated beverages, swallowing air, etc.[note that this is usually belched, though theoretically CAN be farted, too]).
Different foods tend to have different affects on gas in different people. The difference in people is largely due to the individuality of people’s intestinal bacteria, and what those specific bacteria thrive on/produce gaseous by-products with.
While many report egg/cheese issues, many others have no such reaction. It was said in some study (I’ll try to find it for you, after all, a fart study is a hilarious thing) that some people’s bacteria produces little gas, and no smell.
It has been noted by various nutritionists that gas will often be present at the beginning of a change in diet (especially when fiber is increased), but will reduce as the individual “gets used” to the diet.
I have never read anything that suggests that gas would be bad for you, other than the discomfort it can produce, and the fact that it can, shall we say, reduce your appeal to the opposite sex 
One might assume from the theory around adaptation to diets in regards to gas that excess gas may be a sign of bacterial shifts in metabolism, or even shifts in the kind of bacteria dominating the intestines (though this is just my take on it).
Interestingly, the only time I have ever been devoid of gas for long periods of time (days) was while on keto/ad type diets, and yet everything else moved along just fine.
Man, writing about gas like this makes me realize I need a second hobby.
MID
Edit: P.S. Some typically problomatic foods are those that contain calories that have a low level of bioavailability, such as soluble fiber (digested by bacteria and resulting in sjort chain fatty acids and gas, the former of which we can absorb), fructooligosaccharides, sugar alcohols, lactose (to some extent), and others. This is by no means a complete list, as there are NUMEROUS things that cause gas aside from such nutrients…
And, while I’ve done my best to be accurate, there is only so much one man can remember about farts from bio/research.