Running to the toilet ALL NIGHT

I am sooo fed up of peeing all night. I know this is common for pregnant women but it’s just so boring; I want to sleep! I avoid drinks towards bedtime in the hope I don’t pee as much but nothing works.

I know this is quite a common pregnancy symptom, why is that? What’s the science behind it? And does this taper off like morning sickness or I am stuck with this for the foreseeable?