In simple terms, there's nothing magical about it, it's all math.
There is a normalized "input" variable that can range from -1.0 to 1.0, each of them being a "rank" to determine the result, that is, the more negative for -1, the more chances of the result being A, the more positive for the 1, the more are the chances of the result being B.

The calculation consists of a series of complex operations that can return a magic number called "weight", the final choice is determined from the sum of the "input" with the "weight" .

For example, if the input is 2 and the weight is -0.5, the result will be 1.5, which, if we set 0 as the threshold between the two choices, we will get B.

The bias is also just a number added to the weight.

The complex operations to generate the weight occur on top of the dataset, in this way the final weight (which is not something magical, it is literally a number) is like a "footprint" of the results of the dataset, the learned thing.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence