The campaigns don't need to match -- the membership organization does. So as long as they are giving to a fund that is assigned to a campaign that is assigned to the same membership organization, then you should be getting expected behavior.
When a membership is renewed, it does create a new membership record with a start date that continues from the expiration date of the previous record. That way you can look at the chain of membership records over history and see when the upgrades and downgrades were.
If someone gives before the current membership's expiration date, but within the renewal period designated in the membership organization configuration, a new pending membership should be created. Then, if the membership update utility is configured properly to run automatically on a scheduled basis, that pending membership should be made active, and the old membership inactivated, once that date has passed.