Schengen sucks and everyone is looking the other way
I happen to live near the eastermost side of the Spanish-French border, which have crossed plenty of times, and so I'm quite experienced on how things actually work.
First of all, the theory behind the freedom of movement relies in that once you're inside the Schengen Area you can move freely even when this implies crossing internal borders. If you're a legally EU citizen, well, you're already inside; while if you come from outside you would have had your papers checked at the point of entry so, if allowed entry, you have the same freedom of movement, only restricted by the visa expiration or the 90/180 rule.
Of course, things don't work like this at all: there are plenty of people who are inside the Schengen Area but don't have the legal right to be, but once they're inside, they would actually enjoy the freedom of movement if border controls were non-existant as required by the Schengen treaty. The problem arises for two reasons: first, no country wants these people in their national grounds, so they are quite happy to let them leave, while at the same time they don't want even more people to enter. Also, when a person without right to stay is detected, the country who found him is the one who have to repatriate, and this costs money.
So the game on this border is an agreement between the national police forces on each side consisting in "if I found someone coming from your contry to mine without right to stay, I'll return back him to you". While this is explicitly forbidden by the Schengen agreeement, both countries have found excuses to keep these controls up and running: France with its eternal almost but not quite entirely red Vigipirate alert level, Spain with his "I can require your compulsory ID anywhere on the country for no reason at all" law. Of course, once such person is returned back the other state just leaves him alone knowing that, sooner or later, he'll manage to cross the border.
Meanwhile the EU legal citizens are constanty pestered by these pantomime controls.
Extra fun fact: when I went on holiday near the westernmost frontier, I managed to cross many times without any control at all. Which was surprising given the (fortunately past but then still dormant) ETA terrorism issue there. However, if you notice that the Africa-Europe migration axis through Spain runs on the eastermost side...