A glitch is a short wrong value on an output that settles back to the right one. Logically the output should stay put, or change once, but for a moment it does something else.
Why it happens: one input change often reaches the same gate along two or more paths. If those paths have different delays, the gate briefly sees a mix of old and new values, and for that moment it computes the wrong answer.
The simplest example is , which should always be 0. If A reaches the AND gate directly but comes through a slow inverter, then just after A rises both inputs are 1 for an instant, and the output pulses to 1.
A circuit's potential to glitch is called a hazard. Whether a glitch actually shows up depends on the real delays and on which way the input moves.
Does it matter? In a synchronous design, usually not: a flip-flop only looks at its D input in a small window around the clock edge, and the setup constraint guarantees the logic has settled by then. Glitches do matter on anything that reacts at once, like a clock input, an asynchronous clear, or a signal that leaves the chip.