It's based on Karryn's reaction score. Which is essentially an equation that takes into account her slut level, current desire ratings, and masochism/sadism levels. This is the overall system the effects all of her dialogue as well. But more specifically for heart eyes you need to be slutty with high masochism levels and low sadism. Having a moderate amount of sadism will make the heart eyes almost never appear.
Of note, she can't always have heart eyes. During combat she can have them after cock stare, when she's fallen down, usually after a prisoner initates a sex move on her, or when a prisoner cums. With some more other exceptions.