Usually nothing will happen when the battery heats up as it's natural for some batteries such as lithium Ion batteries to heat up when in use and powering large devices.
But if the battery gets hot where it burns your hand then that's not good and could mean the battery is about to explode or catch fire.
If it's just barely warm there's usually nothing to worry about but you should be able to comfortably touch the device or battery with your bare hands without getting burnt.