I have an iPad which I plug into my PC to charge. It always charges just fine and works great. I noticed recently that on the screen it says "Not Charging" and literally laughed because it CLEARLY is charging! What's going on?
Did you try a different charging cable? I don't know much about the proprietary bullshit connectors Apple uses but standard micro USB and USB C cables have multiple power pins for different charging modes; low power slow charge, high power quick charge... Does it take a lot longer to charge now than before? Does the battery last as long. The battery or charging circuitry could be starting to fail. So it could be anything; cable, connector, internal issues...
I'm not having any trouble at all. I just never noticed the "Not Charging" message before. I plugged it in last night and it was down to like 40%, I noticed it said "Not Charging", then this morning it's up to 99%. Tbh, I probably have never looked before.
It's probably in low power charge mode or only charges when it goes to sleep because it's not detecting the proper Apple power supply.
I remember having a tablet that did that, because I didn't have the "official" brand power supply with high power. Basically there is only enough power plugged in to run the processor and display OR charge when asleep, not both at the same time.
When that happened to me on my IPad plus I took it to an Apple shop. The bloke got a little brush thingy out and gently probed in the charging opening and loosened some bits of biscuit and fluff which obviously over time had got lodged in there. That did the job. This happened again on another IPad and I did a gentle probe myself to loosen what was there. Also using a soft vacuum cleaner brush and suction can do it. Be careful, and I am sure you can do it. This may or may not be your problem of course.