The gemara proves that even though we normally assume that one does not receive 2 punishment such as malkus and payment, or misah and payment, nevertheless there is a requirement to pay to be yotzei yidei shamayim. The gemara proves this from אתנן אסרה תורה ואפילו בא על אמו - rashi explains that from the fact that even though he is chayev misah for having relations with his mother, the torah still considers the payment to have status of "esnan", rather than just a gift, clealry indicates that he is obligated at least bidei shamayim to pay. Based on this the gemara holds that if one muzzles a borrowed ox when he works with it, even though he receives malkus, he is obligated bidei shamayim to pay the owner of the ox. Rashi says that since he is technically obligated to pay just that beis din can't force him to pay, if the owner of the animal grabs the payment, he is allowed to keep it.
Tosafos asks why Rava refused to accept the money being offered to him when stolen b'machteres - although the thief wasn't obligated to pay, there was still a responsibility on his part bidei shamayim to pay. Tosafos answers that Rava realized that the thief wasn't interested in being yotzei yidei shamayim and was only paying because the thought that he was obligated to pay. [We learn from tosafos that if someone is paying a debt thinking they owe it in din, but are really only obligated to pay bidei shamayim, it shouldn't be accepted by the receiver].
The Ketzos HaChoshen (28:1) points out that there seems to be a machlokes between rashi and tosafos. According to Rashi that when one is obligated to be yotzei yidei shamayim, even grabbing would be okay, certainly if the person gave him the money mistakenly thinking that he was obligated to pay, the receiver can keep it. If so, according to rashi even if rava realized that the person was only paying due to mistakenly thinking he is obligated to, Rava should have accepted the money - which is against Tosafos. The ketzos reconciles rashi and tosafos with the approach of the maharshal who makes a distinction between whether the person is being punished with the stricter punishment (grabbing wouldn't help) and a situation nowadays where he isn't receiving malkus due to the fact that beis din can't enforce it (so grabbing would help). But the rashash explains that "grabbing" does not give the grabber a right to keep it, just that beis din can't take it back from him. But just as the person who worked with the muzzled animal has a mitzvah bidei shamayim to pay, the person who would grab it from him would have a mitzvah to return the money. Therefore, rashi and Tosafos fit perfectly well with one another - rashi is correct that if the owner of the animal grabs it, beis din will let him keep it, but tosafos is also correct that the grabber should not keep it against the will of the violator.