Based on Lily and Marshall, the olive theory is Ted's way of showing that the perfect couple has found each other. Lily loves olives and Marshall hates them. In Ted's hopelessly romantic mind, this shows that two halves of a whole have come together.