As Tim Cook celebrates his 10th anniversary at the helm, the world’s most valuable company faces fresh challenges