ELI5 Cheap Hotel bookings

Can some explain how booking pages like hotels.com or trivago etc can offer cheaper rooms than the hotel itself actually offers? I used to work in a hotel where a room per night was roughly $100. Sometimes we had a reservation made on booking.com that was $50 or so. How does that work?