Two senses share the verb: literal robbery (
店铺遭劫 'the shop was robbed') and figurative calamity (
遭劫难 'to suffer a disaster'). The character
劫 carries both meanings: it originally referred to a Buddhist 'kalpa' (eon, often a catastrophic one) and extended into 'rob / plunder'.
遭 means 'to encounter (something bad)', always introducing misfortune (
遭遇,
遭殃).