You have two questions, one of which is on topic here and one of which is on topic for Arqade.
"How does Baldur's Gate generate stats" is a video game question that should be asked on Arqade.
Once you have an answer for that,
"Is this stat generation method Baldur's Gate used really from one of the AD&D versions?" is on topic here.
As discussed in ...
I don't think so
While the game is fantasy related, it is not a tabletop role playing game or a freeform roleplaying game. I don't think we can become a repository of all fantasy-related lore and asking these questions on the arqade or another stack would both be more relevant to their stack and give you access to more users who have deeper and direct ...
While a general question about the lore might be off-topic, there are questions about off-topic lore that are none-the-less on topic for this stack. For example:
In an [otherwise off-topic lore] context, I want to create a character
backstory that has the potential to accomplish [stated goals that most
frequently arise in tabletop RPG-specific ...