This clever tip was shared by Paul Marfell on the digiKam Users mailing list. To keep things tidy, digiKam makes it possible to stack related JPEG and RAW files on top of each other. Doing this manually is not that difficult, but if you have to do it dozens or even hundreds of times, that can quickly become a time-consuming and laborious endeavor.
Thankfully, digiKam can group items automatically either by time or by filename. All you have to do is to select all the files you want to group, right-click on the selection, and choose Group > Group Selected by Filename.