Are you sure it is because of the cable? By default Apple devices only charge to 80% when you plug them in and then do the final 20% later around when they anticipate you are going to unplug it.
Its not that. It shows a message about 'non compatible cable'. And when I use the apple cable it quite happily charges to 100% with no quibbles. And the non apple cable is a good quality one that works fine with everything else. I suspect the ipad has been designed to be deliberately fussy.
Our household has a number of iPads and never had an issue with any non-Apple usb-c cable I’ve used to charge them with, mostly Anker branded but one or two AmazonBasics or Cable Matters brand. I’ve never seen an incompatible cable warning, my suspicion is it’s a cable that doesn’t have the right signaling to go above 5V, so it’s stuck charging at 5V and the iPad prefers to charge at 9v or 12v.