In my experience, if there are multiple qualified candidates it usually comes down to things like who lives closest (so we don't have to pay to move them here)? Who was the most friendly/likeable? Who might have a skill that we might need in the future? Etc.
Asking candidates where they live is illegal. You can not discriminate based on exact location. (It’s okay to ask if they need relocation of course, but you can’t decide based on who is “the closest”)
I don't need to ask them. I've never ever seen a resume (and I've seen thousands of resumes) that doesn't have the candidates home address at the very top.
Have you ever seen a resume that doesn't have the candidates address at the top of the page? I haven't. We typically receive hundreds of applications for any one job. We phone interview maybe 20 of them and in person interview maybe 10 of them. Those who we don't hire are never given a reason why we chose someone else. They don't know if it is because they don't have the requisite skills or because they live 2000 miles away and we would have to pay to move them to our state.
This isn't to say that we never hire anyone from out of state. We have done so on many occasions. But if there are 2 equally qualified candidates, we are more likely to choose the one that already lives close by and can start immediately.