Some airlines do sell last minute seats on the plane cheaper when your purchase last minute.
But usually it's because the airline has some empty seats on the airplane available and when those seats on the airplane are empty the airline doesn't make any money on them.
So the airline will usually be willing to sell off those seats to be filled for just about anything and you can usually get a good deal on seats that are leftover.
However you're not always guaranteed to have a cheap seat but sometimes you might.
I once got a deal through America Airlines on a seat for $150.00 whereas the same seat would cost me $400.00 but I wasn't looking for the deal and just had too book an emergency flight to see family for a funeral and I happened to get the good deal.