They do track the index.
The leeway to deviate is not intended to make bets on individual equities, but to - for example - match index returns with fewer execution costs.
For example an index fund that tracks a global equity index may not find it practical to own shares in every listed company globally, but absolutely will be judged on its tracking error vs the benchmark index.