predict() is a generic that has methods defined in each package; the correct method is chosen depending on the class of the model. Use the class() function to determine it.
For example, if class(obj) == "randomForest", predict(obj) is automatically calling randomForest::predict.randomForest(obj).
For example, for randomForest. For kernLab, there are several predict() methods that are chosen depending on the model, e.g. predict.gausspr(), same for qkr and ksvm.