Actually it is a small part of it. The role of gut biome (which we barely understand) is far larger. I say that not just from shitloads of actual science papers, but personal experience.
Will power is a nice story we like to tell ourselves. Do you know what is considered success for weight loss? Do you know how many people achieve it? The numbers have zero to do with will power