It is like the Skeleton Key movie where there was these two people that could switch souls with others and steal their bodies, but it wouldn’t work until the people whose souls they were trying to switch with believed that they could really do it. And in that moment when they believed they both got this look in their eyes like the knew and by knowing they believed and then just like that they lost the hold on their body and switched. It was a crazy movie.
I actually think that Emma has some sort of magic even if it is just in her belief. Though i think that some of it is happening without her believing, but you can see her wonder like when she blew out the candle on her cupcake in the pilot and right then someone knocked she looked down like did i do that and when she put on the badge and right then the mines fell in she thought for a second did i do that. I am not exactly sure how it all works though.