Most of these answers are total rubbish.
when you FEED a cat, is just instinctively knows where to return for meals.
My first cat was trained to go in the litter box and then we moved the litter box outside.......and then removed it totally.
He was an inside/outside cat........and came and went as he pleased.................same as my second cat, a female.
She learned that if she wanted to go out.........she would stand by the door and meow, or she would come and find me and be annoying, until we let her out. She now has total run of the Vineyard....and traipses all over. But Always comes back to where her clean water and food are.
If you feed a stray cat.............I guarantee you,.....you will have a new cat for life.
Cats remember where the free food is. But yes, outside cats generally do not live as long, due to the various dangers of being outside.........fighting with other cats, or animals, being chased by dogs.......and there is FIV......which is a type of AIDS for felines. ----that can easily be picked up from feral cats in mating season.
My first cat lived for 8 years.......and was outside every day. ........and only died because of a liver problem.
My current cat is 5 years old , also outside every day, and she's a small, sleek wisp of a thing.......but I've seen her fight off cats twice her size. She doesn't take sh*t from anything.