Coordination numbers and radius ratio
Coordination number is the number of the nearest neighbours of an atom, and it is related to the Kepler's conjecture. For CN12 (12 is the 'kissing number' of a 3D sphere), there are two possible ways for the spheres to be 'packed' which are HCP and CCP. Space-filling efficiency they two are exactly the same, and it is why one coordination number can correspond to two crystal structures.
The crystal structure of metal may depend on many features, and the space-filling efficiency is just one of them. Even by the thermal expansion, the crystal structure can change. (Tin is the most familiar example.)