I often see an indirect pronoun (such as lhe ou me) applied to a verb describing the subject's action, but with reference to the object. With certain verbs, I've intuitively come to know the resulting meaning. However, I can't come up with a consistent rule. At times, it can be equal to de + personal pronoun, such as:
Os chefes despediram o Rui pois, roubava-lhes o dinheiro da conta.
Os chefes despediram o Rui pois, roubava deles o dinheiro da conta.
Note how in the second part of the sentence, an indirect pronoun (lhes) is used to reference the object (os chefes) of the verb "roubar".
However, in other cases, de + personal pronoun is not necessarily the case:
Quanto aos homens, a máquina cortou-lhes os dedos.
Quanto aos homens, a máquina cortou os seus dedos.
Is there a consistent rule for this construction? Or does it solely depend on the verb; requiring either foreknowledge or intuition to deduce the meaning?