Lost and in need of help

They will hire the person that they see as the best fit for working within their existing team, assuming that the person also has the skillset required for the role. This goes both ways of course, and you can absolutely decline an offer because the cultural fit isn’t right, even if your skills are suitable. Being happy in your workplace is important.

As they say, it’s about who you know and not what you know. I’d say the two are equally important, and that this is very good advice.