It could be that you feel bothered by the urge to pee, and wake up because of that.
After all, you can wake up from sunlight and from loud noises, so it seems logical that an uncomfortable desire to go to the bathroom would wake you up as well.

Although this is of course probably only when you really need to go to the bathroom.
It would be pretty unpractical if your body woke you up just because you "kind of" "feel like" going to the bathroom.