Why do they call military tags dog tags?

Dogs are given metal tags to put on their neck collars to identify them and tell people who are their owners. Therefore the troops dubbed their military identification tags worn around their necks dog tags.