Bleeding during Sex?

So my period ended the day before yesterday, and all day yesterday and all this afternoon I hadn’t bled at all. I had sex with my boyfriend earlier and I began to bleed?? This has happened before, and I’m confused as to why. Help???