The relation between eating and imbalances is quite simple. According to Ayurveda, diet is just as important as your digestion. The second you overeat or consume any food or drink in excess, you have just set yourself up for an imbalance in your physiology including gaining weight.
Ati is Sanskrit for excess and this in itself, excess of anything, will ultimately be the cause for any imbalance. Eating an excessive amount of any food will disturb your Agni, or digestive fire. When your digestion is disturbed, this leads to ama, or the build up of toxins. Ama is undigested food. This will cause Ajirn, or indigestion. And it is indigestion that will lead to the imbalance.
When you have overeaten, your stomach will have a tough time digesting and metabolizing the food. You should only eat about 2/3 of your capacity and leave some room in your stomach for your stomach muscles to work and digest the food. For example, when you completely stuff your mouth with food and you barely have any room to chew or swallow, a similar thing happens in your stomach as well when you stuff yourself. With no room for effective digestion, you will create ama in your physiology.
To sum up this process, Ati disturbs your digestion, which leads to ama, which causes Ajirn, and this ultimately leads to an imbalance in your physiology, which will cause the weight gain and/or disease. This is a chain reaction, one leads to the next, with excess being the root cause.
Ati (Excess) –> Affects digestion –> Creates Ama –> Ajirn (Indigestion) –> Disease/Imbalance
To avoid weight gain, any imbalance, or disease, have everything and do everything in moderation. For example, do not overeat, do not overindulge, and do not stay up too late. Anything in excess means that you are burdening your own physiology. Prevention is key, so avoid anything in excess and have everything within your limits.
If you are specifically trying to lose weight, it is a good idea to not overeat and watch what you eat. Rather than counting calories right off the bat, start with paying attention to what you eat and how much of it. Notice when you feel full. And notice when you feel stuffed. There is a huge difference between feeling full and being stuffed. Feeling full means that you are satisfied with the amount of food you have eaten and are still feeling energetic. If you feel tired or lethargic immediately after a meal, then this means that you have overeaten.
Enjoy everything in moderation!