It's impossible to do the identical thing twice. Try it. Try to throw a ball absolutely identically twice. That's not possible. Each time the ball will end up flying slightly different. So obviously "doing the same thing over and over again" cannot mean "doing an identical action over and over again".
Because that would be equivalent to "the definition of insanity is performing an impossible action". That's nonsensical.
Thus "the same thing" must refer to that the overarching action is the same, not that every detail is identical. And that's what you do when you practice: You e.g. play the same song on the same instrument over and over again. Crappy at first, proficient in the end.