The difference is in the intent. A security camera films a place and doesn't focus on individuals. If the camera were to run software that would autofocus on a person, that would make them a subject, there would need to be consent.
You'll find a helpful diagram (though incomplete) on this page https://fr.wikipedia.org/wiki/Droit_%C3%A0_l%27image (French), and there's of course (as anything legal, it's a rabbit hole) more specific laws concerning security camera.