It's not very clear what you're looking at. Can you be more particular about where you found the numbers that vary between websites? Direct links to both the PokemonDB page and the page of the other website would be helpful.
If you mean what I think you do by "base value" (e.g. Bulbasaur has base 45 HP and base 49 Attack), then I don't think the numbers on any website vary. They would all get the data through similar methods, or even the same place outright -- according to the about page, this site uses Veekun and PokeAPI which are both popular.
To answer your question directly, the info on this site (and others) would be found using some combination of these techniques:
- extracting data directly from the ROMs (not as easy nowadays),
- regression analysis (assisted by the fact many formulas in Pokemon haven't changed for decades),
- using data collected by dataminers/ hackers/ leakers,
- some things like TM compatibility are reasonable to get from the game itself,
- getting data from databases, which also would have used the above techniques (e.g. PokeAPI as previously mentioned).
Again, we can't give a precise answer without knowing exactly what you're looking at.
(Disclaimer: I didn't make PokemonDB, but the person who did isn't always here so I'm writing something in the mean time. I know these things because I've done them before.)
Response to edit: Thanks for clarifying. I think your problem is that you don't know how stats in Pokemon are calculated, and you're comparing numbers that aren't equivalent. There is no randomisation going on -- the numbers you put into that calculator directly inform the numbers that come out.
The stats you see on the left side of Bulbasaur's Pokedex page on PokemonDB are "base stats" (e.g. 45 HP and 49 Attack). Base stats are different for each species, but they don't change -- they're hard coded into the games, and that's why there is no "base stats" option in the calculator you're using. There is no need to change them.
Instead, you have a row for level, another for "DVs" (an outdated term for IVs), another for EVs, and another for nature. If species (and therefore base stats) is held constant, then those are your independent variables, and the cause of the differences you're seeing. You can read about them here if you're curious.
As far as PokemonDB is concerned, trying reading the grey description beneath the bar chart:
The ranges shown on the right are for a level 100 Pokémon. Maximum values are based on a beneficial nature, 252 EVs, 31 IVs; minimum values are based on a hindering nature, 0 EVs, 0 IVs.
Put those numbers into the Psypokes calculator for Bulbasaur. It should give you the same numbers you see on the right side of the bar chart on PokemonDB (i.e. the maximum and minimum stat).
For example, at level 100 with 252 EVs, 31 IVs and a positive nature (try Modest), Bulbasaur's Special Attack is 251 according to both Psypokes and PokemonDB.