Usually it is via merger or the Airline is in the middle of transitioning. Although both AA and DL have made use of having a mixed fleet by ordering both narrow body types.
BA has both as it is transitioning away from the 737 to the 320.
Having a mixed fleet is not that unusual. AA and DL had large MD80/DC9 fleets while shunning the smaller 737 alternatives.