Initially, when the cannon and bullet is at rest then the initial momentum of the system is zero. But when the bullet is fired it acquires some higher speed and exerts the force in the opposite direction to the canoon. As the mass of cannon is higher than the mass of bullet therefore, the speed of cannon is less and the speed of bullet is higher due to which the distance covered by cannon is less than the distance covered by the bullet. Therefore, to conserve the momentum of the system bullet and cannon gains speed but due to their masses the magnitude of speed is different which results in the difference in distance covered by them.