Weird leakage

last night i put my cup in at around 9 and went about my business until i slept at 3. I didnt notice any leaks at all when i went to pee or anything. However, when i woke up this morning i realized i leaked. My cup was only halfway full so i dont get how my cup leaked while i was sleeping. If my cup wasnt in properly shouldnt it have leaked before i slept? Any ideas on how the leak happened?