I don’t usually intervene on forums that are not related to Rawtherapee. nevertheless, as @cedric presented a screenshot of the ‘temperature correlation’ algorithm. Here are some simplified explanations and a link to Rawpedia (technical)
The White Balance problem is complex. If you look at academic publications, you’ll see that many algorithms have been tried. Most of them try to find a middle gray. About ten years ago, I tested 5 or 6 of these algorithms, but I wasn’t convinced. But how do you do that when there’s no gray?
Then I saw an article (in 2017, but I don’t remember where…), not at all documented, which gave as a lead the correlation of colors between those of the image and reference spectral data.
For several years I’ve been working on this (complex) algorithm, which involves a large volume of code and a lot of spectral data.
There are 429 of them, divided between skin tones, sky tones, near neutrals and, of course, all the colors at the limits of the CIExy diagram.
For image analysis, the one we want to treat, I use a maximum of 236 colors.
For more information, here’s a link to Rawpedia
Auto Temperature correlation
To use all the algorithm’s functions, check the box
Preferences > Color Management > Show White balance Auto temperature correlation settings.
The technical text explains the system’s limitations. The main problem is the illuminant, which must be close to the Daylight illuminant between 4100K and 15000K, and Blackbody between 2000K and 4100K. However, it also works when the CRI (Color Rendering Index - which reflects the proximity of an illuminant to Daylight) is “correct”.
The second problem is that an image often contains parts in the sun and others in the shade. In this case, you can perform a chromatic adaptation (with Selective Editing) of the part concerned.
Another very important point is that we correct the usual blue-red axis, but also the green-magenta axis.
An excuse my bad english 
Jacques