The celebrated Russian playwright Anton Chekhov explained this principle of drama on a number of occasions, so you can, if you trawl the literature, find several quotations on the subject, and indeed several variations as it is all translated from the Russian. So I'm going to paraphrase Chekhov, rather than quote him:
If a rifle is seen hanging on the wall in act one of a play, then by the end of act 3 it must have been fired.
In The Seagull, (someone will correct me if I'm wrong), this is literally what happens. It is intended as an explanation of how the playwright (and by extension, the Director) communicates with the audience, but more especially, an explanation of audience expectation.
When at the theatre, the audience is in a state of heightened awareness, in particular, heightened awareness of the shape and characteristics of a story. Spectators will see meaning in the smallest detail; the angle at which chairs are placed; whether an actor takes his left or right hand to smoke, the color of the drapes, the visibility beyond a doorway; you name it.
Vsevolod Meyerhold made a particular study of the actors' movement and gestures, in an attempt to make the actor as hyperaware as the spectator; to ensure that the actor would make no movement, no gesture, without a control and an awareness of the effect on the audience.
These ideas are especially true in literature, and they impinge not only on reader awareness, the communication of plot, and on reader satisfaction, but also on theme and symbolism.
Chekhov's gun is often used in thrillers and mysteries as a means both of direct foreshadowing (giving vague indications of future events) and of thematic foreshadowing (using visual images to represent future themes). Indeed for the latter use it is used in all genres. As a technique it enables you to raise reader awareness without providing too much information. It also gives you opportunities for justifiable misdirection.
Justifiable misdirection is when you allow the reader to form a wrong conclusion. If you do this directly, either by giving the reader an untruth or by bluntly concealing something, then the reader will be annoyed, and accuse you of trickery, but if you show the reader images that strongly imply a foreshadowed event that later fails to materialize, the reader's satisfaction can be increased. This kind of thing can be tricky, but for thriller writers it is worth a try.
Detective Inspector Wallis is investigating a murder that seems at this stage to have been motivated by the desire to silence a witness. In accordance with procedure, Wallis looks up previous similar cases and finds four cases that resemble it closely, all unsolved, all originally assigned to the Chief Inspector.
In my editing notes I call this a C&O - clumsy and obvious. Supposing instead that:
Detective Inspector Wallis is investigating a murder that seems at this stage to have been motivated by the desire to silence a witness. He needs extra resources for the investigation, but has trouble getting to talk to the Chief Inspector. When he does get to talk to him, the CI is diffident, and unwilling to provide the resources needed. A couple of times his responses seem incomplete or inexact.
This creates a doubt in the mind of the reader, but initially just a doubt as to the relationship between Wallis and the CI. This can be later reinforced by the CI doing something confusingly obstructive at a key moment.
The thing is that in real life people behave this way all the time. What it does to the reader is tune his sensitivity to that of DI Wallis, who will tend to be suspicious of everyone. The more characters behave in ways that are not directly easy to explain, the more suspicious both Wallis and the reader will become. You then drop in symbolic visual details to enhance the effect - the light in the corridor outside the CI's office flickers annoyingly; he shuffles papers of an unusual color on his desk; his filing cabinet draw jams and makes a queer grating sound.
All this is, to some extent, Chekhov's gun. What the skillful author does is to give many details that the reader might reasonably interpret as significant even though most of them are not. If those apparently significant details can tie into the theme then so much the better. In this imaginary book, the main theme is the apparent inefficiency of Police procedures, symbolized through the faulty fixtures, fittings and furniture in Police buildings and vehicles. Associate just a few too many of these symbols with the CI and the reader's attention will be fixed on him.
In conclusion, Chekhov's Gun can be a very blunt instrument if applied in the way that Chekhov describes it. But it can also be applied subtly and gradually. It is essential to be aware of it, however, because the reader will be annoyed if you tell him that the main character has a black belt in Karate, but never gets into a fight. This is a failed Chekhov. Chekhov's gun can also be subverted, but this should be done with care; if it is too obvious, the reader will be annoyed.