Many great opportunities don’t get advertised. When organizations are looking for someone to fill a strategically important role, it shouldn’t be that surprising, but they’re strategic about the search, and will likely engage the services of an executive search company, or headhunter.
If you’re looking to move into a leadership role or between such roles it may well be a search company that gives you that opportunity. But it’s unlikely to be pure luck that leads to an approach from a headhunter.