Conservation of linear momentum
If this experiment is done in a situation where the net external force is zero on the loaded cannon just before and just after firing (like when the weight of the cannon is balanced with the normal reaction of the ground), then, when we calculate the product of the mass of the bullet by its velocity and the product of the mass of the cannon by its velocity just before and just after firing, we will find that before firing both were at rest so the product is zero for both, while, after firing, the two products are of the same magnitude but the velocities of the cannon and the bullet are of opposite directions.