Each build process template has a parameter called SupportedReasons. This enum is normally set to all, but you can also unselect the option ValidateShelveset to disable a shelveset build option, as shown in the picture below :

During the build pipeline, TFS build service account will running tf command to unshelve in the "Get Version" property in the advanced section of the "Parameters" tab on the "Queue Build" dialog.
It's using tf unshelve Command which will restores shelved file revisions to the workspace on build agent.
Then TFS will build source files the same as others. You could either check the build log to get more detail info, or open your build process template and click each activity to understand how the build pipeline works.