It could also be integrated into HFS+. Doing so, though, would stick the metadata to the file system, so when moving the folder to a different computer, it gets lost. Hence putting it in the folder.
I only ever saw the .DS files when browsing my Mac volumes from Windows and since Windows is unable to browse APFS volumes I have no idea if they are still there.