plan b fail

Could someone please explain to me how the plan b actually works?

I had sex, I took the plan b due to a split condom, within 2 hours, I realised the app said I ovulated that same day.

Two weeks later I tested positive on a pregnancy test.

Does that mean I ovulated before the pill? Or after?

For it not to work?

Sorry if I sound ignorant, I’ve just read two different things and I’m so confused

Could somebody please kindly explain?

Thankyou!!