Possibly preg and just ate raw egg

I'm so dumb. But its so yummy! Mmm... moosy cheesecake

Actually, i'm still eating it. Heck, I ate 1 piece, a 2nd piece isn't gonna make me anymore ill, lol.
Why do they tell you not to eat raw / slightly under done egg when preg? is it cause of the risk of samonela?