I include a link to an article that purports to explain the separate sections of policing in Spain. The article is popular, rather than official.There is a positive relationship on the part of the different branches of the police throughout Spain towards pilgrims, from my observation of posts on this forum, and also in Portugal.
In addition, the C20th history in certain parts of the peninsula might surface not so positive feedback from citizens who suffered somewhat from the way one of the branches (National? I am not sure) operated. That is anecdotal, not scientific information, so I will not elaborate.
There are basically 3 divisions of the police force in Spain; Guardia Civil; Local Police and National Police.
www.spainmadesimple.com