My IUD fell out??

I’ve had my IUD (mirena) for almost two years, with no problems whatsoever. But I went to the obgyn last week just to get my yearly checkup and they were checking for the strings and couldn’t find them... so they looked a little deeper and it turned out my IUD had slipped out and was resting half in, half out of my cervix. My doctor had to yank it out and it was stuck so it hurt really really badly, I started crying, it was a whole mess. My doctor offered but I couldn’t get a new one that day because I was in too much pain (I know I know I’m weak) Anyway I guess I’m just wondering: should I get another? I’m worried it will fall out again. Does anyone have any idea why that happened and if it could happen again?