XKB is a really complicated beast indeed. (At least in my experience. It seems to have some weird design decisions which I attribute to the fact that it's first release was way back in 1996, and also not the best documentation in my opinion.)
I have managed to get to some level of understanding by experimenting with lots of different configurations and settled on a subset of functionality that I can reliably guess the behavior of and comfortably create layouts with while still having enough flexibility to express what I'd like to achieve.
Writing a comprehensive tutorial of what I've learned would take quite a bit of time, but what you can do is take a look at my configuration files which are hopefully more digestible than reading the default layouts.
(They are included in my Sway config here.)
I particularly recommend the
Lenovo-L13.xkb file, which I've created for my laptop, as it has multiple layers. (I've even turned my space bar into a modifier while held down with evdoublebind.) The Vortex Core layout is also a good one, but that's not the full picture, as the keyboard itself is also programmable.
If you need something that cannot be found here, as the previous answer has already mentioned, the place to start is looking at are the built-in files. You can get an idea of which of them are utilized for your keyboard by using
setxkbmap -print. From then on you can look up the imported definitions in wherever your
xkb files are located.
(Unless you're using NixOS it's probably in some reasonable place, like
/usr/share/X11/xkb under Arch.)