From all I've seen, the only scientific assumptions derived from current experimental data are:
1. Calories in/out control weight
2. Not everyone's digestive system is exactly the same, thus some small variance exists in how many calories we each absorb from various foods. This variance is very small, but maybe some exceptional outliers exist with very strange conditions here that could dramatically affect digestion. Don't justify your weight on this, you are most likely not the outlier and are just eating too much :p
3. Insulin levels and other hormonal conditions could affect the ability to lose fat. Again, this assumes major imbalance, most likely due to medical conditions like diabetes or hashimoto, etc.
4. The body needs what it needs. So a diet is more than just weight loss. You need a balanced diet, not necessarily balanced in foods, but you do in nutrients. It doesn't take much of anything though.
5. Certain foods have extra curricular effects that can be good or bad. It really depends in the food and your body. Intolerance, allergies, carcinogens, antioxidants, and many others. You can think of food as medication that is micro dosed, and with possibly immeasurable long term effects.
Also, it does seem that trans fat affect heart disease, as well as sugars. And it is the interaction between both which creates a high risk scenario. That's why both diets work. Ideally, you even cut out both, which is what Keto often does, it favour healthy fats and cut out sugars.
P.S.: Sorry, I wish I could put down my sources, but I wasn't keeping track. This is the current synthesis from memory of the many studies I read over time for fun in the last 3/4 years.