How does KDE use systemd to run applications as services?

When running Krusader one can see in the journal (journalctl) that it’s being run as a systemd service:

paź 15 10:21:54 myhost systemd[1441]: Started app-org.kde.krusader@2afd24ec5acc40599209dbdba916b96a.service - Krusader - File Manager.

When has KDE started to use systemd to run applications and where can I find information on how it’s done?

There’s similar question What internal command does the KDE autostart mechanism use to start applications? but it’s concerned more with autostart applications than running applications in general. In that topic there’s a link to Bringing modern process management to the desktop blog post which has some interesting information but it’s fairly old (from 2020) and describes very early stage of development and plans for the future. I guess I’m looking for information which would have been in continuation (part 2) of this blog post if it existed.

When has KDE started to use systemd to run applications and where can I find information on how it’s done?

There are two paths. Initially the process was started manually by forking in a traditional manner and then telling systemd to manage that process

Now we just tell systemd to start it directly for us

Thanks for pointing relevant place in source code.
It seems the way applications are started by desktop environment is pretty important thing which many users would be interested to know about more. Putting aside source code is the way KDE starts applications documented somewhere?
Would you mind taking a look at my other question How to limit memory size used by specific application in KDE? where I’m asking how to use systemd directives to control specific application?

I dont think its interesting for users as long as it works.

If a more techy user is interested code is available to look at.