Sonic and Dr. Robotnik are codependent. They don't actually want to defeat each other. That's why Robotnik is always building these elaborate bases that, for some reason, have a bunch of perfectly Sonic-sized tubes for getting around in. And it's why there's always that moment at the end where Sonic is chasing Robotnik but doesn't catch him.