The most likely explanation is that the dog was picked up by someone and has been living with them for the past 12 years. Dogs have sometimes returned home after running off on a trip, but most dogs don’t have a well developed sense of direction. They can get lost after chasing a squirrel.
The people who had the dog all these years might have abandoned it due to its age. I’m glad the original owner got her back.
I can't say the same about my dog, a big Sheltie who looks for all the world like a small Collie. I used to walk him off-leash at an isolated place across the highway from where I lived and one day he got spooked and just ran off. I found him an hour later outside the house waiting to get in. He had not only found his way home on a path we had never walked, but managed somehow to get across six lanes of busy highway!