Streamlabs collects it in real time
Streamlabs may store the historical event on it’s own services
On overlay load/refresh the overlay fetchs it from the historical systems that Streamlabs itself runs.
Twitch doesn’t really do much in terms of “historical” events.
So use the relevant API’s to collect data in “real time” and store it in your own history database tables/cache. If you need historical recovery.