It’s based off information data mined from the game. You can see the development of the formula of you look through Reddit. I don’t believe CG ever released any specifics about how it works, but they seldom give details on how the game actually calculates anything.
For my purposes, it’s accurate enough. Much of the information we have on game calculations came through datamining and testing by players. I can understand wanting CG to give details, but without that I’ll trust this tested information versus speculation from people.