The component that actually creates the ProcessID for any process is the Global Logging Capture component. If this component exists and is enabled in a project when the project is executed it will generate a ProcessID and put an entry in ReportProcess.
If you go into the Project settings of your project and look at the Reporting tab you will see an option called Process Prefix. This value is set to WF- or WE- by default. Along with this value you will find a Pad Char & Pad length option to control how many characters should be padded after the prefix and what character to use.
When the project is ran for the first time, either thru debug or published, the Global Logging Capture component will look in the ReportProcessGenerator table for an entry matching your defined Process Prefix. If the entry exists it will increment the LastUsedIdentity field by 1 value and create a new Process ID with that new number. If no entry exists in the ReportProcessGenerator table for your defined prefix it will create one and use it going forward.
Hope this information helps you understand how the process works.