When you test several values for a parameter (for example 100 and 300 trees for a Random Forrest), a cross validation is done on TRAIN dataset to choose the best value.