It’s an excellent analogy because, as with sex and masturbation, people eat for all kinds of reasons that are entirely unrelated to appetite.
Social situations and celebrations often involve food. There is ample documentation that a lot people eat as a coping or self-soothing mechanism- some even eat in their sleep. An individuals choice of portion and diet are referred to as habits, because they are habitual.
Some people starve themselves to death. And while all of this documented behavior is related to a biological function, none of it is determined by biology. It is all the result of social and mental conditions.