Perhaps not immediately obvious, but your On My iPad and iCloud file storage are entirely independent. Anything saved in On My iPad is local storage on the device - that is not synchronised with iCloud or other devices.
Many Apps, such as Pages, allows you to configure your preferred storage location to meet your needs. If you wish to synchronise with iCloud and other Apple devices, you’ll need to select this in iPad settings:
Settings > Pages > [Allow Pages to access] Document Storage - select iCloud Drive

Having selected iCloud as the storage location, the Pages App will use this as the default storage location for its documents - and will have created a corresponding App library folder in iCloud storage.
Should you choose to do so, you can move (or copy) your existing Pages documents to the iCloud folder - either using the Pages file browser, or using the File App.