I doubt they'd actually ask you about it (and thus give you a chance to "explain" yourself), HR would just note you down and you'd be more likely to be laid off, less likely to get promotions approved, etc.
This is not how companies work (at least the ones worth working for). Retention risk is a reflection on their current role, compensation, manager, etc.
We have absolutely promoted high performing employees and/or given them raises even though we knew they were looking at other opportunities.
I wonder if there are any courses for managers to train them to think logically about this and not switch into bad decisions based on emotion.
Companies waste so much money on hiring and then deciding to react very slowly to changes in market conditions. If businesses treated their staff like they treat their clients...