Shaking has the additional benefit of reducing the viscosity and making it easier to dispense, due to ketchup being thixotropic.
That and poor sauce technique.
Part of the problem here is people not closing the bottle at the table. Humidity condenses inside of the bottle, which is typically still cold from the refrigerator.
This constitutes yet another example of where we have substituted a chemical for a physical process.