There are several reasons why birds fly at certain heights. Species that feed on the wing choose an elevation at which their preferred prey is most abundant. So swallows hunt fairly low to take larger flies; house martins go higher to seize aphids and midges; and swifts zoom around higher still to pursue the smallest invertebrates.
A decrease in prey availability due to poor weather conditions can lead to some overlap, but hunting at a range of heights generally reduces the competition.
Some birds fly at particular heights to minimise energy expenditure. Petrels and albatrosses, for instance, travel very low to make use of the uplift caused by waves, while griffon vultures soar very high on rising thermals.
Many small migrants gradually gain altitude during their long-haul flights, climbing from 1,000m to 6,000m. This allows them to take advantage of the thinner air, which is easier to move through when their cruising speed and power begin to fade.
The travellers aren’t affected by the low levels of oxygen, since they can competently extract it from the air, nor the cool temperatures, as plenty of heat is generated by their busy flight muscles.