How does it work then?

Let's take 106 again. 6A is the hexadecimal for 106. Hexadecimal uses 16 "numbers" instead of decimal 10 and binairy 2. So 1 2 3 4 5 6 7 8 9 A B C D E F.

Instead of using 2 to the power of the position we use 16 to the power of the position. So to convert 6A we do A times 16 to the power of 0 which is 1, since it's the first number (programmers like to start counting from 0). So 10 (A is 10 in hex) * 1 = 10. Then we do 6 times 16 to the power of 1 which is 16. 6 * 16 = 96. 10 + 96 = 106.