Many of them are very intelligent people and mathmaticians who are very capable at cracking codes and decoding the stats of Pokemon by just looking at them. They usually have many sources in various countries, most notably Japan , Nintendo etc... and go through a lot of brainstorming.
However they most commonly work in teams that try to seek out information and dig out as much as they can.
Very much like how the method of the masudo method was decoded by a community called Smogon.
A lot of our knowledge on Pokemon we can thank to the geniousity of hackers. Despite patience being a virtue, due to Nintendo usually leaking stuff a little later, hackers can usually bring as what we want to know before it is released, such as the revealing of Diancie, Volcanion and Hoopa, months before they were released.
It should also be noted that Nintendo / Game Freak are excellent coders and thus usually always give us a few hints, as Diancie, volcanion and Hoopa's names were compatible on the GTS as well as the move Light Of Ruin being on the menu list in Lumiose City's hotel.
The games usually also leak many things, such as locations, which you can see by looking at the pokedex, as well as body types etc...
As I mentioned, patience is what really brings us the knowledge. Par example, having to wait for a gym leader / Elite four / Champion to use all of their Pokemon's moves in order for us to know what moves their Pokemon have and possibly what item their holding by utilizing abilities or items such as Frisk or Knock Off.