how do mining pools expose their stats?
Mining pools export this functionality via API's.

For example, poolin's API docs are here: https://btc.com/api-doc

Here's F2Pool's : https://www.f2pool.com/developer/api

And so forth. 

The way aggregators add value is by compiling all this data from different pools into a neat user interface.