I have a pet hypothesis that one of (for instance) Keto's main benefits is that it shakes up habitual eating patterns. Instead of trying to eat less of foods you're used to eating a lot of, you're forced to develop new habits around entirely new food.
I've also gone from 250-ish down to 170-ish (although over the course of 2 years, not 4 months, lol), but I haven't really bought into any specific diet. I just don't eat out.