# What is the meaning of the terms in this evaluation function for chess?

I'm trying to improve my evaluation and I saw this here

materialScore = kingWt  * (wK-bK)
+ queenWt * (wQ-bQ)
+ rookWt  * (wR-bR)
+ knightWt* (wN-bN)
+ bishopWt* (wB-bB)
+ pawnWt  * (wP-bP)


How do I get the value, let's say wK? Do I get the position of the king and score it relative to the board? For example, wK is more safe than the bK, so let's say wK - bK = 1 - 0.5. So, the result will be 90 * (0.5). Is this really how it works?

So for example if white has 8 pawns and black has 6 pawns, the last term of the score would be pawnWt * (wP-bP) = 1 * (8-6) = 2. (assuming the value of a pawn to be 1) That leads to a relative advantage for white only based on pawns, but according to how many of the other pieces are on the board, black might still have an advantage.