An insect gets stuck in the sticky resin, the resin flows over the insect and it is trapped.
Over millions of years the resin hardens into amber. Simplified it goes so when an insect becomes a fossil amber inclusion. The amber is itself a fossil and with the enclosure becomes it "double". Only a fraction of ambers have inclusions. Often trapped insects or plant parts are wonderfully well preserved that no other fossilization can match.