As can be seen in the tutorial num_classes is used to initialize a new linear layer, which acts as the classification layer.
The output activations will provide num_classes outputs, which represent the logit for each class, i.e. output[0] would be the logit for class0.
If you define your Dataset, you would have to make sure that each sample is mapped to a valid class index.
E.g. in your use case with num_classes = 2, your target should contain the values 0 and 1.
The mapping between these class indices and the meaning is made by you.
I.e. if you only care about the background and car class, you would have to make sure the you are only using samples containing these two classes.
The mapping is arbitrary. So you could define background = 0 and car = 1 or vice versa.