When I was a manager, I had a rule that all my directs had to always be looking for new opportunities. If they find something better, I wanted them to leave. It made sure of 2 things for us: 1. We knew that anyone could leave at any moment, and we always planned accordingly. 2. We knew we had to keep people happy. If someone didn't like something, we had to change if possible or that person might leave. Conversations about having interviews and being contacted by recruiters became open, honest, and casual. There was no fear about someone might find out if you were looking, and people shared what they found out about talking to potential employers.
Had a manager at Microsoft that made me do that. Thought it was really weird at the time, and certainly wasn't anything like a company policy, but here we are 20 years later. It's a story I tell my reports all the time and it just works so much better to be able to rely on everyone being around because they have decided they want to be.