How China built up its dominance in rare earths