Charging is a chain. The wall adapter converts mains power, the cable carries it, the port accepts it, and the battery stores it. A failure anywhere in that chain stops the battery percentage from rising, even when the screen shows the charging symbol.
Cables fail more often than chargers. Inside the sheath, thin wires break near the connectors from repeated bending. A cable that only works at one angle, or only with one adapter, is usually the culprit.
The charging port collects lint and dust, especially in pockets. A partially blocked port lets the plug sit crooked, so the contacts do not meet properly. Cleaning it carefully with a wooden pick or compressed air often restores a solid connection.
Wireless charging adds another layer. Cases, magnets and misalignment on the pad can all stop power from reaching the coil. If wired charging works but wireless does not, the pad or alignment is the problem.
Batteries age. After hundreds of cycles they accept less charge and may report a higher percentage than they can actually hold. A battery that jumps from fifty percent to empty, or stops charging past eighty, is usually near the end of its life.