They’re actually communicating with your phone over the wire to determine the exact safe rate of charging depending on your phone’s state of battery. At the same time they’re converting the wall’s AC current into DC thru a series of steps like rectifying, filtering, etc and it’s all in that little cube