Expedia isn't checking availability, a middle man is, (one of the three GDS).
The middleman isn't checking availability every time because there's a cost to ask the carrier. And if you ask too much they will rate limit or deny you which means you get no availability.
The middleman is a price aggregation person, and tries to find rates and routes using all the rules the carriers specify.
Sure you can buy tickets directly from AA or UA. But what if you want to fly a connection that has both. Do you think AA wants to sell seats on someone's else plane?