I think that I've found the required settings to get DigiKam and Darktable to cooperate over tags and star ratings.
The first important point is to keep in mind that Darktable keeps all metadata in its database for fast access. This happens when an image is initially imported into Darktable. If an XMP sidecar file exists then data is taken from this file. Once an image has been imported into Darktable the database entries take precedence over the XMP file. Subsequent changes to the XMP file by any other software are not visible to Darktable.
However, a preference does exist in Darktable that will cause Darktable to look for changed XMP files at start up and ask if the database should be updated with values from the changed XMP files.
The required setting is:
look for updated xmp files on startup
Once set Darktable will ask if data from changed XMP files should be loaded.
And on the DigiKam side.....
Settings -> Behaviour - Reading and Writing Metadata
set "Update file modification timestamp when files are modified"
Settings -> Sidecars - Reading and Writing Sidecars
set "Read from sidecar files"
set "Write to sidecar files" plus setting whether data is written to "item and XMP sidecar" or "XMP sidecar"
I've left "Use a compatible file name for writing to sidecar file" un-checked, but only because I'm not sure what it means.
Well that's what I'm using at the moment. I can't promise that it is perfect, but I think it works. No guarantee!