I have done a bit more research on my own question and I think I can answer the question now. Specifically I was interested in:
Is it true that most people put on weight because they consume more
calories than they burn?
I got access to some medical journals and found several articles and books on obesity and weight management. The hard thing about the question posted above is that search for information about weight gives a lot of articles about policy making and related issues. But, I have found that in the background section the point is often made that weight gain is ultimately a result of taking more calories in than one uses. To quote a couple of sources:
According to Weighing the Options: Criteria for Evaluating Weight-Management Programs
Obesity is a heterogeneous disease in which genetic, environmental,
psychological, and other factors are involved. It occurs when energy
intake exceeds the amount of energy expended over time (page 38).
Also, Exercise in weight management of obesity. states
Simply stated, weight reduction depends upon energy intake compared
to energy expenditure. (page 463)
Also, Current views on obesity states:
The ultimate cause of obesity is an imbalance between caloric intake
and energy expenditure, but the pathologic mechanisms that lead to
this imbalance are still not understood.(page 231)
With this in mind the important question for many is how to expend more calories than one intakes in a safe and healthy way. I see other questions dealing with this. For example https://skeptics.stackexchange.com/a/23302/25659 makes the point that drinking water before a meal can make you feel full and therefore can cause you to intake fewer calories.
So with respect to the question
Is it also true that weight gain may be due to an underlying health
condition?
the answer is yes. The other answer makes this clear. There are a lot of factors that determine how many calories you expend and how well you absorb and store calories from the food you take in. To add to what the other answer gives, stress can for example being a "cause" of people gaining weight. As
Obesity in Women states:
There is increasing evidence that psychological stress plays a role in
the development and maintenance of obesity. ... Individual differences
in stress sensitivity and the hypothalamic-pituitary-adrenal (HPA)
axis affect stress-induced eating behavior in women. (page 428)
(Not trying to pick on women here.)