In the end the simple process of installing Music opened up the link with my iPad which had hitherto been invisible in the M1 iMac Finder, except for Photos. Most of my library miraculously appeared despite the fact that Music said that my iTunes Library wasn't valid.
Buit then I realised that a different 40Gb of music was on my iPad. I considered Sync, but this advised that it would erase what was on the iPad, before adding the music from my iMac. Not what I wanted.
In the end I discovered a useful app called iMazing which transfers music (amongst other stuff) from the iPad to the iMac.
Many thanks for your help