One is to enhance cardiopulmonary function and shape a good figure. One is an exercise that emphasizes muscle strength and beauty.
Swimming is competitive and practical. Fitness is not a competitive sport, bodybuilding is just to show muscles.