Hopper gathers information on flight costs, and its algorithms examine pricing patterns to make predictions about future flight costs based on historical costs. This is how Hopper determines whether to book the flight right now or wait for a lower price.