How do cheap phone chargers charge li-ion batteries?
The device (phone, etc.) has the special charging circuit built-in. And the battery pack typically has a special circuit inside to prevent excessive discharge (or charging).  Li-ion battery cells are inherently unstable/dangerous and require special circuits somewhere (often built into the battery pack) to make them safe to use.