The trick works because of the way multiplication and adding work with a lot of numbers. It's kind of an involved algebra problem. The way to see how it works depends on breaking the whole trick down into separate parts, one for the person, one for the hand, and one for the finger. If you look at each of these number separately and do all of the math that follows after you enter that number into the trick, you can see how the whole trick works.
So, because the trick starts with the person number, look at that number first. The first thing you do is multiply it by 2 in step 1. Look down at step 3, and you'll see that you multiply everything before that time by 5. That means you multiply the person number by 2 (in step 1) and then again by 5 (in step 3). So what you've really done up to this point is multiply the person number by 10 (2 X 5 = 10). What this does is move the person number over a digit without changing it. So, say, a person number of 3 becomes a 30. Now, look down at step 5, and you'll see that you multiply everything up to that point by 10. So now the person number gets moved over another digit to the left. Thus, the number 30 becomes 300, for example.
Now let's see what happens in steps 2 and 3. First you add 3 to your number, and then you multiply it by 5. So at this point you are really adding 15 to everything up to this point. Now, in step 4, when you add 8 for the right hand number or 9 for the left hand, adding one of these to 15 gives you a new total of either 23 (15 + 8) or 24 (15 + 9). Then, in step 5 you multiply this number by 10 and get either 230 or 240. When you add that to the person number - which has its digit in the far left hand digit and two zeros in the two right digits, you end up adding a 2 to the person digit and putting a 3 or a 4 in the second-place digit. For example, 300 + 230 = 530. Notice that now both the digit -- the one in the hundreds place -- and the middle digit -- the one in the tens place -- are 2 more than the correct numbers. Remember that we will be subtracting a 2 from each digit at the end (that is, we will subtract 222 from the total number).
In step 6 you put in the number of the finger. Then you add 2 to it. So it, too, equals 2 more than it should. Notice, too, that because you can't have more than 5 fingers, adding 2 can't make the finger number go over 9 -- which would make you change the number in the tens place and mess up that number.
So, when you subtract 222 from the final number that you are given, you get the correct numbers in each place, and you can tell what the person number is -- it is in the hundreds place, and you can tell which hand is the correct one -- a 1 or a 2 will be in the tens place, and you know which finger the string is one because that number will be in the ones place.
Thanks to Liz, who wanted to know why this trick works.