I've edited https://wiki.debian.org/LightDM and written https://wiki.debian.org/Xsession from scratch. I hope this helps other people who were as lost and confused as I was.
If you're still wondering what kind of documentation I was looking for, you may use https://wiki.debian.org/Xsession as the answer. That's what I wanted to see. I will be able to point users to this page in the future. Thanks to all who provided information.