I suspect (and this isn't my idea) Keto works because it reduces the amount of dietary sugar and increases dietary fiber. It is the high sugar/low fiber diet that causes insulin resistance, metabolic dysfunction, microbiome issues, inflammation, etc. So keto may not be ideal, but is way better than the standard western diet.