if the cog kept on coming loose, then the lockring wasn't tightened to the cog. or the lockring and cog didn't make adequate contact. repeated accidental loosening and tightening of the cog chewed up the threads - additionally problematic if it was a cheap cog with threads that are more likely to chew up a hub's threads.