I'm not sure what there is to explain.As documented,col tells you where each element corresponding element ofC is found inS. If the element ofC is found in more than one position, you'll get the first one of these.
The code is also flawed and will error if any element ofC is not found at all inS. The safe version of the code would be:
S = [1 3 0 2 0 0];
C = [0 2 4]; %note that the original code would error because 4 is not present is S