The Geometry of Prompting: Unveiling Distinct Mechanisms of Task Adaptation in Language Models