Because language models are large probability distributions trained on Web data. When asked for a citation, the model searches its training data for the most probable domain to use as a reference. Then, considering the prompt and response context, the model estimates the most likely URL path to add to the selected domain.