It's the magic of our base 10 system :-)
Basically what you're doing is eliminating the second digit and then
subtracting the first digit from 10 times the first digit which
always give 9 times the first digit. On the Egyptian chart at the
end, all the multiples of 9 always have the same symbol next to them. [Sandra note: All except the nines are just random dummy-art because only the multiples of nine will be "the answer." The program changes the symbols on the chart each time you play the game.]

Algebraically it goes like this ...

If a number looks like ab, it would be represented algebraically as:

10*a + b.

So for:
12 then a=1 and b=2 so 12=10*1 + 2

37 then a=3 and b=7 so 37=10*3 + 7

82 then a=8 and b=2 so 82=10*8 +2

In the first step of the game they ask you to add a and b together.

And then they tell you to subtract that number from the original
number.

That's just a way of eliminating the last digit so all
problems turn into:

10*a + b - (a+b)

rearranging, you can see that the b part of every 2 digit number gets
eliminated:
10*a - a + b - b

So all problems turn into either 10-1, 20-2, 30-3, 40-4 ...
10*a - a = 9a

10*1 - 1 = 9*1 = 9

10*2 - 2 = 9*2 = 18

10*3 - 3 = 9*3 = 27

and so on. So all two digit numbers are turned into 9 times the first
digit of the number.

Joyce