/sys, like
/proc, is a
virtual filesystem. Actually, it is a very sophisticated
API, since none of the "files" and "directories" in it actually exist.
Here's a good foundation paper on the subject:
https://www.kernel.org/pub/linux/ker...005/mochel.pdf.
Of course, since it was written many years ago now, the implementation details will have changed. But it is an excellent overview of how this interface works, and how it was implemented.
Everything that hooks into this API emulates one or more
files, directories, symlinks, and so on. (Refer to the PDF, especially starting in Section 6 and beyond.) In this regard,
/sys is a bit more-ambitious than
/proc, but the essential concepts and facilities are very similar.
At some point, there will be a software object that corresponds to that LED-control, and it will be expecting
(probably ...) a
sysctl() call. Linux will direct the call to this object when it comes in, and the code, executing in kernel-mode, must do the right thing.