Yes, it's just a way of making the sentence more concise without sacrificing the meaning.
I will go to the supermarket whether they want me to [go there] or not.
I think no one would ever say: 'I will go to the supermarket whether they want me to go to the supermarket or not.'
It was hard, but I kept on; I had to.[I had to keep on going]
He made the problem worse, but I don't think he meant to. [I don't think he meant to make the problem worse]
Student or Learner