It doesn't magically come from anywhere. Consciousness would have to magically come from somewhere first, because it's completely unlike and other entity in existence. It is an entity that 'looks' back at everything else. It is not spatial, or temporal, and it can't be reduced to anything other than consciousness.
Yet, this arises in a material, spaitial, temporal entity called an organism. Magic? Ok, but that's an imaginary cause being ascribed to a real thing. If you think it takes magic to get to free will, I don't know how you'd ever explain consciousness.
The answer to your questiono is that free will is not separate from the rest of reality. What it is free of is the power of reality to direct it. Most animals can't control what they pay attention to. Instinct handles that. Animals with free will are fully capable of directing their own capacity to focus.