On the emergence of the abstract concept of symmetry in physics