When you're in residency, you will be recruited like you wouldn't believe (I guess it might depend on specialty?). Recruiters email me daily, probably about 10 emails a day are from recruiters. They call me, they text me, everything. I don't even know how they got my number. I had to block multiple companies for this reason and I still get a call every couple of weeks or so. They know nothing about me, don't have my CV, all they know is my specialty and that I have my license. Aside from that, it's connections. If you want to stay at the place you did residency, you will likely be hired unless you were a problem resident. If you want other opportunities, you just cold call or meet people through others you already know.