Phones get warm when they charge because of the energy moving inside them. Like how a cup of hot chocolate warms up your hands, the electricity flowing into your phone makes it feel warmer. It's like giving your phone a little hug from the inside, and that hug feels like heat.