When Thorin dies, Nim Deathmantle triggers, causing you to pay 4 to return Thorin from your graveyard to the battlefield and attach Nim Deathmantle to it.
When Thorin enters, it triggers, attaching Nim Deathmantle to Raphael, and then having Raphael deal 6 damage to itself.