Why Does a Shunt Cap Help For Deglitching Digital Signals?
This is a signal line, not a power line, you are asking about right?
The resistor does strengthen the effect, however, it is possible to have too much of a good thing. The RC filter is not smart enough to discriminate between transitions due to noise and transitions due to your signal.
In this case, it is probably slowing down the edge which reduces transmission line effects such as ringing, undershoot, and overshoot. However, the stepper driver's input requires a sufficiently fast transition to minimize the time spent in the ambiguous region between logic HI and logic LO, in order to operate properly. If you lowpass filter too much, it begins to deglitch even good edges which causes the transition slow down too much and spend too much in the ambiguous logic region which then confuses the stepper driver.
The same thing can be achieved by removing the 1nF cap with a series resistor. This method utilizes the inherent input capacitance of the stepper driver inputs, whereas your &quot;deglitching cap&quot; method utilizes the inherent output resistance of the driver and line.
As far as slowing the edge to reduce transmission line effects, low R with large C achieves the same lowpass filtering as High R with low C.
ADDITION SINCE OP IS ASKING ABOUT SPORADIC GLITCHES CAUSED BY NEARBY STATIC:
However, if the issue is induced noise, the shunt capacitor is more resistant to induced noise than the series resistor precisely because it requires the line to be driven harder to register a change in the signal. However, it does not discriminate and both noise sources and the driver must work harder. I would expect a series resistor to do nothing against induced noise.
In your testing, you say it behaves worse with a resistor and capacitor than with just a capacitor. I think this is probably because the resistor provides some isolation between the input and the driver. In essence, it weakens strength at which the driver holds the input at a particular voltage level which makes it easier for induced noise to cause changes.
Have you tried something like placing a Schmitt trigger at the stepper input with no capacitor or resistor?