Does the change of camera effects the prediction?

Hi,
I trained YOLOv5 using images of walnuts captured with different cameras. The model achieved 98% accuracy on the training data, 98% on the validation data, and 96% on the test data. However, when I test the same model using images captured with my phone, the prediction confidence is significantly lower. May I know the reason for this drop in performance?