Even the most simple CNS will have an internal representation of other entities of various categories and keep track of whether each one is Good or Bad in a contextual manner. Good to eat, good to swim alongside, bad to be near bc it will attack me, good to mate with.