"a" means one of a group.
"the," when it is singular, means you know which one it is.
You can say "A dog ran past," but you can not say "A same dog ran past," because the word "same" proves you can identify the dog, that makes it unique, so you must say "The same dog ran past."
Or, A cop came to the door. The cop returned. (if the same officer) A new police officer would be "another cop," or "a second cop."