Most models of iPad require a Power Adapter rated at 12W (i.e., 2.4A @5V) or greater to reliably charge. 5W Power Adapters (1.0A @5V) intended for older models of iPhone are inadequate to charge an iPad; if the iPad charges at all, charging will be very slow. Recent models of iPad are supplied with a 20W USB-C Power Adapter.
Some third-party USB-C power adapters (and portable PowerBanks) may not support USB PD (Power Delivery). Power Delivery mutually negotiates the charging voltage; the source, load and cable are all elements involved in the negotiation protocol. Unless the Power Adapter explicitly supports USB PD, it will almost certainly fail to charge the iPad; proprietary charging standards, such as QC (Quick Charge), are not supported.
Many computer USB ports don't support USB PD, instead supplying the older standard 5V USB bus voltage to power (or charge) connected USB devices. If your iPad can charge when connected to a standard USB Type-A port that is capable of 12W (2.4A @5V) or greater, but cannot charge from a USB-C power source, this would suggest a failure of the iPad's USB-C charge controller. In such circumstances, the iPad may require repair.
If you continue to experience difficulties when using an appropriate Power Adapter of 12W or greater, you would be best advised to visit the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) - where the technicians will be able to hands-on test and assess your iPad, Power Adapter and cable(s):
Genius Bar Reservation and Apple Support Options - Apple