It's basically governments who agree to share one another's data.......
https://www.theguardian.com/books/2022/oct/02/the-secret-history-of-the-five-eyes-untold-story-international-spy-network-by-richard-kerbaj-review