In inference/tool use it's doing the same thing that a human is doing in that regard. Just faster.
In training, it's a blind process. It's up to the trainers to feed the model accurate sources.