I'm trying to better understand databases and networking.
Basically my question is how do websites like these access player data from the game when they're not affiliated with the company?
Do you have to have permission by the website to read their statistics? Are these databases private? What are different scenarios I could do to emulate something similar to this but within a java swing application.
Best How To :
In barely any case would you get direct access to another company's database, even if you are affiliated.
The most common way would be an API (which might be public or licensed): https://en.wikipedia.org/wiki/Application_programming_interface
If the data is publicly available on a website, some do content parsing although this is not the best solution (as any change of the website structure might cause a malfunction of your parser, it's slow and needs way more resources and you might get into copyright trouble).
I am not sure to which data exactly you refer in your mentioned cases and what the source is though.