Imagine I'm taking Calculus 2 and I have a choice to learn the material and take the final exam "cold" or I can get the final exam a few months ahead of time and simply memorize the symbols I need to write into the exam booklet. The latter is self-evidently gaming the system.
When primary school teachers teach directly towards the assessment exam, they are only incidentally teaching the subject and are primarily (IMO) gaming the system as well.
But the latter is not going on here. They are not memorizing the symbols.
> I have a choice to learn the material and take the final exam "cold"
What does cold means? Learning calculus without solving exercises? Or without solving variety of exercises? Intentionally ignoring last years tests and not trying them?
If your learning materials match what the test is supposed to test, you will solve a lot of exercises while learning from them. And the test itself would contain combinations and variations from these.
When a measure becomes a target it ceases to be a good measure.
A test is a proxy for actual performance working on some useful task. The nature of useful work is usually that it can't be represented by two hours of multiple choice questions, whiteboarding, or anecdotes about "a time you disagreed with someone"; therefore, most tests will differ from the work. Learning to pass the test is easier than learning to do the work, but if you do that the test ceases to measure your work performance.