Why A CW signal's occupied bandwidth depends on how fast the envelope switches on and off. Fourier analysis says an abrupt, near-square keying envelope contains high-frequency components, which appear as sidebands spreading well beyond the few hundred hertz a properly shaped CW signal needs. Those broad sidebands are heard on adjacent frequencies as sharp clicks each time the key closes or opens. Good transmitter design shapes the envelope with rise and fall times of roughly 5 ms to keep the signal clean.
Watch out Harmonics are integer multiples of the operating frequency produced by nonlinearity in the amplifier chain, not by envelope shaping; key clicks land just a few hundred hertz to a few kilohertz either side of your own signal.
Fast edges = wide skirts. Sharp keying makes clicks near your signal, not harmonics up at 2f.