There has been a known association between genes and obesity.
There are over 50 genes studied which are strongly associated with obesity and there are many more which would be known after further studies. Certain genes are protective and ones with these genes maintain a near-normal weight. On the other hand, certain genes may make someone more prone to obesity. However, there is no need to be helpless. Genes can only predispose to obesity. The other environmental factors like lifestyle, dietary pattern, and choices, activity grade, etc. can add fuel to the genetic tendency and induce obesity.
It is known that there are some genetic syndromes that can lead to obesity due to the defect or absence of certain hormones. These are purely genetic forms of obesity and fortunately rare.
One example of a boy I witnessed had leptin deficiency. Those with leptin deficiency by birth have uncontrolled hunger because of the lack of the hormone and the child continues to demand food all the time and eventually succumbs to obesity. What can be learned from this is, if you have excess/ uncontrolled hunger, it could be because of the imbalance of certain hormones, known or unknown. Such a person should seek an opinion from a bariatric physician.
Those who have a history of obesity in families have a higher incidence of severe obesity as well as associated disorders like diabetes, heart disease, etc. Even though genes do play a role in this, they are not the primary or the only reason for this type of obesity. Fortunately, bariatric surgery and certain medications work well in such forms of obesity with strong family tendency.