Clean Your USB-C Port
Let’s face it: most of us could do a better job of keeping our iPads clean, and that includes its own port.
If your iPad’s port is dirty enough, the charging cable might not be able to charge your iPad, even if it’s plugged in correctly.
Before buying a new charging cable, be sure to clean your charging port. And that goes for both the iPad and the Magic Keyboard if you use one.
To do this, first, you need to turn off your iPad. Do not use any liquids to clean the port. Instead, try using a soft and dry cloth to remove any debris you might find. You could try using compressed air, too, but be very careful and make sure you only use a little bit.
After you clean your port, try charging your iPad again and see if that does the trick.