Sky Masterson’s Law says: “The race is not always to the swift, nor the battle to the strong, but that’s the way to bet.”
Occam’s razor says that given multiple hypotheses, the simplest one is preferable. Occam’s razor is like Sky Masterson’s law: it doesn’t say the simplest explanation is always better, it just says that’s the way to bet. Technically, this is called a heuristic: an approach that isn’t guaranteed to be optimal or even rational, but that gives reasonably good practical results when an optimal approach isn’t known or feasible.
Now, Occam’s razor is not a law. Newton’s laws of motion and gravitation are simpler than Einstein’s special and general relativity, but special and general relativity are better explanations for observations of the real world, once we have good enough measurements to see the difference. But Occam’s razor is a good heuristic — it turns out to be right a lot.