A total of $871 is being paid to buy back the shares, and so the total equity must reduce by $871.
Share capital will only reduce buy the nominal value of the shares cancelled, and therefore the rest of the 871 must come from retained earnings.
(Share capital plus reserves (i.e. equity) must equal net assets. So if net assets fall by 871 (because of the cash payment) then equity must also fall by 871).