Your Magic Keyboard for iPad has a USB-C pass-through power port in its spine - that can only be used for charging the iPad. This port serves no other purpose.
Charging the iPad via the Magic Keyboard will make absolutely no difference to your iPad’s charging rate. When used with your iPad’s 20W USB-C Power Adapter, you should experience little (if any) difference in charging performance - the iPad being able to charge at its maximum supported charging rate (~20W).
Your iPad is designed to be used while charging - and will suffer no ill effects when doing so. In some circumstances, such as very high CPU/GPU load, the iPad may modify its charging strategy to reduce generated heat - this being an entirely automatic protection mechanism.
Your iPad will also suffer no ill effects through being connected to its Power Adapter for extended periods. Your iPad will automatically regulate and optimise charging - and will not overcharge the battery.
When used in kiosk applications - where external power is connected for extended periods of time - the iPad may modify its charging strategy and limit battery charge to ~80% of maximum. This modified charging strategy is designed to reduce chemical ageing that might otherwise occur if 100% charge is maintained at all times.
Nominal 100% charging will be restored when a normal charge/discharge routine is restored.
In summary, using your iPad while connected to its Magic Keyboard and Power Adapter, for extended periods, will cause no harm whatsoever.