All iPads, regardless of model, will charge the internal battery when connected to a compatible external USB power source via its USB-C or Lightning connector.
If the iPad battery is fully charged, if power needs are fully met by the external source of power, the internal battery will simply be maintained while the device itself is effectively being powered from the connected Power Adapter or computer.
Most models of iPad require a Power Adapter rated at 12W or greater to reliably charge. 5W Power Adapters intended for older models of iPhone are inadequate to charge an iPad; if the iPad charges at all, charging will be very slow.
Be aware that many computer USB ports cannot source sufficient power to charge an iPad. Unless explicitly designed for charging connected devices, computer USB ports are typically limited to 0.5-1A @5V (i.e., 2.5-5.0W).
You may need to verify the specifications of the source USB (USB-C?) port to which you intend to connect your iPad. If the source cannot provide sufficient power, the iPad will invariably draw additional power from its battery to maintain operation.