All weight loss is because of a calorie deficit; that isn't (or shouldn't be) controversial.
The interesting questions are why a diet produces a caloric deficit, and how difficult that deficit is to maintain.
The "don't eat anything and drink nothing but water" diet produces a caloric deficit through a very obvious mechanism, but it isn't something people can adhere to long-term.
Semaglutide produces a caloric deficit by turning off the mechanisms that make people want to eat, and appears to be sustainable long-term (assuming you can financially afford it).
With the potato diet, the question isn't exactly "why did they lose weight?" but more "why did participants reduce their calories?" Were they so sick of goddamned potatoes that they couldn't bare to shove another one down their throat? If so, that indicates that the diet is unsustainable. On the other hand, if people were enjoying the diet and reduced their calories because the potatoes left them feeling fuller, longer, that's a mark in the protocol' favor.
Weight loss studies aren't about finding ways to reduce calories, they're about finding ways to reduce calories that people will comply with. And based on how often diets fail, and how often people regain all (or more) of the weight lost once they stop dieting, I would argue that we actually haven't figured out the answer to this yet.