Q-switching is a technique by which a laser can be made to produce a pulsed output beam with extremely high peak power - much higher than would be produced by the same laser if it were operating in a continuous wave (CW) mode. Q-switching leads to lower pulse repetition rates, with higher pulse energies, and much longer pulse durations.
Q-switching is achieved by putting a variable attenuator inside the laser's optical resonator. When the attenuator is working, light which leaves the gain medium does not return, and lasing cannot commence. This attenuation inside the cavity corresponds to a decrease in the Q (quality) factor of the optical resonator. A high Q factor corresponds to low resonator losses per roundtrip, and vice versa. The variable attenuator is commonly called a 'Q-switch', when used for this purpose.