How do airlines set their prices?

Have you ever had the unpleasant feeling that the more you research your flight, the higher the price gets? Rejoice, you’re not crazy - but...