The purpose of these files is to provide an easy means for other processes to communicate with them (e.g. send signals). This only makes sense for long running services, that’s why you find much lessfewer such files than processes running.
Usually those files are created by the service they represent, you will find a parameter like --pid-file or so in the invocation.
Depending on the type of init-system you will find files for services in different places.
- sysv-init:
/etc/init.d/ - upstart:
/etc/init/ - systemd:
/etc/systemd/