Look up induction
electricity flowing through a wire creates a magnetic field (think like a shockwave from a fighter jet, except an infinite queue of fighters jets follow eachother. The analgoy is not perfect but it’s to visualize). Now if we make a coil qith the wire, the magnetic field gles theough the coil and “circles around” from one tip to the other. If during this circling, the magnetic field goes through another coil, a currenr is generated in the second coil proportional to the variation of magnetic field (constant current=no variation=no generated current in second coil. Alternative current=variation= current generated)
TL;DR: Your phone contains a coil that “grabs” the magnetic field and creates a current by a phenomenon called induction
Latest Answers