Refusing food, hiding; these are all signs that the animal is upset, but not a guarantee that they are on the end path. We nursed one cat through weeks of not eating, feeding him marmite dissolved in water to get him to drink and as an appetite stimulant.
He lasted another 6 months, blind, with horrible injuries that didn't heal. But he was really happy and died lying on an old jumper laid over youngest son's feet, still purring away.
Conversely, my 'first' cat (the first one that was really mine) seems perfectly healthy, eating, but a little skinny. Then (reportedly, I was away at uni), she uncharacteristically started yowling at my bedroom window at night a couple of nights in a row, then disappeared, never to be seen again.