When the test questions are in the training data. The model then scores brilliantly by recall rather than ability, and the number tells you nothing. Because training corpora are scraped from the web and benchmarks are published on the web, this happens by default rather than by accident.
Technical view
Detection methods include n-gram overlap against the corpus where accessible, comparing performance on items published before and after the training cutoff, and testing sensitivity to perturbed or reordered variants of the same question. Mitigations include held-out private test sets, continuously refreshed benchmarks, and canary strings that publishers embed so contamination can be checked. Reported scores on old public benchmarks should be treated as upper bounds.
Related
Part of AI Terminology Index, section: Measuring Performance.