Question about the appearance of herpes

So after having sex with my partner, somehow after a few days we both had a herpes outbreak. We are trying to figure out how we could have got them. His theory is that maybe we had an outbreak because we once did it when i was on my last day of my period. But I doubt it? We did not cheat on each other or what so ever so what else could have cause herpes?

one of you must have caught herpes from past partner’s before as herpes cannot come out of nowhere!

it can remain dormant and only appear later