PrincipalProvider is a way to pass information about a user to various layers of a project. In this example, the web project registers a concrete WebPrincipalProvider and provides the user from the http context.
You could create a concrete for use in a job/service to provide a system user for example.
You can inject IPrincipalProvider in a service and then call _principalProvider.ClaimsUser.Claims... or get the UserId.