Calorie counting restricts calories (obviously).
Fasting restricts calories (and hopefully enough to lose weight).
Keto often ends up lowering calorie intake, because you feel more full on fewer calories.
Exercise burns calories, helping contribute to weight loss (or at minimum, slowing weight gain, all things the same).
etc. etc.
There's no magic in Keto or IF. It's mostly just calories in, calories out. Anything else that it's doing is minimal enough to not worry about it.
The only thing that matters is finding something that works for you. If that's Keto, great. If that's IF, great. If that's just old-fashioned calorie counting, great.