Google displays the most profitable ads first. So a low-paying ads that tends to get a lot of clicks, thus conversion, thus more profits, will beat a high-paying ad that doesn't get clicked on, etc.