A code share is basically a merger without merging
Thats a pretty big generalization. There are all sorts of codeshares and not all of them are set up for the same reasons, including ones that permit interlining and joint revenue sharing to places where one airline couldnt fly and vice versa.