If this is the Google Photos folder system, I suspect the problem was that the IDs and the bucketing were de-linked.
Photos creates folders for you based on identified themes, and then adds new photos to them as they're taken. I haven't checked, but I'm guessing it doesn't relabel existing buckets to avoid causing confusion. And I'm not sure whether bucketing is done by assessing theme or similarity to other photos in a folder. If it's the latter, the system could have hit the confidence threshold to make a Dog folder out of a few images, then ceaselessly dumped similar-looking photos (i.e. cats) into that bucket.