This answer is based on my experience in industry and working on the recruiting platform for my current company for several years.
In any case, the mere fact that someone has a certain skillset doesn't automatically mean that it's easy to secure a position in another country. For example, maybe their skills in the target language aren't very good. I'm not terribly familiar with the job market in Spain, for example, but I imagine that if you don't speak good Spanish it could make it more difficult to secure a job there (regardless of how good your other skills are). It's also often an advantage to have good English, so you could potentially be expected to effectively be trilingual (if you come from a country whose primary language is something other than English or Spanish).
Many wealthier countries have highly restrictive immigration policies as well that deliberately make it difficult and expensive for employers to hire people from overseas; between that and potentially being expected to help out with relocation costs (and obviously the cost of flying someone in from a foreign country and putting them up in a hotel and providing them with meals), many companies have a strong incentive to hire local candidates where available. Obviously the immigration issues wouldn't apply to applicants moving between E.U. countries, but it would definitely apply to cases where either the candidate or the target company is outside of the E.U. Also, the relocation cost and interview cost issue would still apply.
If a flight costs, for example, $300, two days of a hotel costs an additional $250, and meals cost $50, it costs $600 to interview someone from a different country (vs. $0 to interview someone locally). Multiply that by 5 candidates and you've added $3000 to your recruiting cost for that position. That's not even including relocation costs, which according to this source at least costs, on average, $21,000 - $24,000 (in the U.S. at least). Again, the relocation cost of hiring a local candidate is $0. That being said, hiring an out-of-country candidate could cost an extra $27,000. These are obviously very rough numbers, but you get the point: it's a significant added expense.
This is particularly the case for academic fields that have an oversupply of people that have a terminal degree; for example, in the U.S. at least there's an oversupply of people with law degrees and the number of law schools is decreasing, so the remaining law schools could presumably afford to be quite picky about who they select. This also particularly applies to areas, such as certain arts, where it's common for a master's degree to be considered a de facto terminal degree. In these fields, there's little incentive to hire from overseas unless the applicant has a truly exceptional record.