Thanks very much for this detailed reply. On my iPad and iPhone I looked at the sort order of the folders and they were properly set to Name but were still sorted in two groups with each group sorted by name within its group. I changed the order to Size and that did sort the folders by size according to the number of items within each folder. Then I changed it to Kind and it returned the folders to the strange order of two separate groups sorted by name.
I have a feeling that the folders that have ended up in one of these two alphabetically sorted groups -- but not the folders in the other group - may have been copied over from Microsoft's OneDrive. And in so so doing they got invisibly marked by iOS as a separate 'kind' even though they look exactly the same. (I'm not sure what sort order by "kind" actually indicates here.)
I went to my Windows PC and browsed to icloud.com and I have the same situation there.
When I rename a folder, it renames it successfully but its position remains within either of the two groups.
I force-closed the Files app and rebooted - no change.
All my Apple devices are up to date with the latest version of iOS.
The solution I've arrived at: for each folder in the smaller of the two alphabetized 'groups' (smaller meaning there are fewer folders in that group), I create a duplicate folder with a slightly different name. That new folder then sorts correctly into the larger of the two groups. Then I move the documents from the original folder to this new folder. It's an easy if laborious workaround. But the techie in me sure would like to figure out why this is happening.
For what it's worth, when I look at the 'Kind' attribute in Info, both types of folders (the folders within each alphabetized group) are all simply called 'folder'.