great question, this remains a puzzle and there are lots of different reasons why this occurs. Our brain likes stuff that are not healthy for us and companies know this so they will keep at it as they know it makes them money. Most of the unhealthy stuff has very little nutrients so we keep getting hungry quickly and we opt for stuff that gives energy very quickly and sometimes that’s why we snack. It’s a cycle.
If you put that together with less activity we will become unhealthy. The basic rule is we should burn more energy slight more than we eat. It’s about getting the balance right.