What exactly is the formula for Elo points?
If E(a) is the Elo rating of player A and E(b) the rating of player B, the system calculates S(a) = 10^(E(a)/400) and S(b) = 10^(E(b)/400). The probability of A winning is then L(a) = S(a) / (S(a) + S(b)), and the probability of B winning is L(b) = S(b) / (S(a)+ S(b)). If A wins the game, A gains 20 * (1 - L(a)) additional Elo points, and if A loses, 20 * (1 - L(b)) = 20 * L(a) points are deducted, since L(a) + L(b) = 1. The same applies to B with the signs reversed.
Example: A has 1,200 Elo points and B 1,600. S(a) = 10^3 = 1,000. S(b) = 10^4 = 10,000. L(a) = 1,000 / 11,000 = 9.09%. L(b) = 10,000/11,000 = 90.91%. In other words, B is considered 10 times more likely than A to win the game. If that is the outcome, B gains 20 * 9.09% = 2 additional Elo points, since the win is very close to the prediction. If B loses, however, 20 * 90.91% = 18 Elo points are deducted from B and given to A, since A is then considered an underrated player who should move closer to B in points.