The Mechanistic Emergence of Symbol Grounding in Language Models