They used to be lovers who met with a tragic end, but reincarnated, and now they're on different sides and worst enemies.
They meet each other when both are disguised, and are like "huh, that person looks weirdly familiar", but are attracted to each other, and after getting closer, start to remember their previous lifetimes and are like "ah, that's why I thought they looked familiar".
Eventually, though, they find out that they're enemies, and this leads to a fight, but when one has a blade at the other's throat, they can't follow through and kill them, remembering their time together, and instead let them go.
The male lead returns to the side he's on, but can't stop thinking of Mary-Sue, and after some more instances of gazing at each other intensely across the battlefield and writing each other secret letters and meeting disguised accidentally and then spending the night together with the promise that they'll never speak of it and the like, he gives up everything and leaves his side to join her.