An ad exchange functions like a digital auction house, linking buyers (ad agencies, advertisers, and demand-side platforms) with sellers (ad networks, publishers, and supply-side platforms) of advertising inventory to facilitate bidding. It enables real-time buying and selling of ad space across various platforms, including mobile and desktop.