Swimming is a team sport made up of many indivdual and relay races. In professional meets there are 3 seperate parts.
Heats, Semifinals, and Finals. In the heats all of the qualifying swimmers swim based off of their entered times. There are 8-10 swimmers a heat and depending on how many swimmers there are there will be a different amount of heats.
The top 16 times that are legal make it to the semifinals and after that the top 8 swimmers will swim in the finals.
However in youth swimming there are generally only Timed Finals which is one race to see who wins, or Prelims and Finals which is 2 races one to qualify for the Finals and then 1 final race to determine it all.