An iPad will automatically restart when connected to its Power Adapter. That said, you should be able to shut-down the iPad while charging - should you choose to do so. This behaviour is unchanged with iPadOS 17.x.
If your iPad persistently restarts during charging, this might suggest a problem with your Power Adapter or the charging cable - noting that both the Power Adapter and USB-C cables incorporate active electronic components.
Charge and monitor the iPad battery - Apple Support
Troubleshooting generally requires substitution of the Power Adapter and cable for another known-good item. 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.