Why does discharge increase towards the end of pregnancy?

I know it's normal but I have had so much discharge and I am just wondering what causes this?

Thanks!