The consecration is not a kind of magic. It is God who works the change, though only an ordained priest may validly lead the congregation.
Eucharistic Prayer III says explicitly: '...Father, we bring you these gifts. We ask you to make them holy by the power of your Spirit, that they may become the body and blood of your Son, our Lord Jesus Christ,...' Therefore it is the Father who consecrates through his Spirit. The priest merely says the prayer, in the name of the community."