One way to think about it is the resistor is setting a current limit on the capacitor. In an ideal situation with no resistance, you could potentially have very very large amounts of current being drawn in this "short" situation. Because of this you need to add a resistor. The resistor limits how much current is able to flow which results in the frequency characteristics changing.
Now in the not so ideal case, everything has some resistance. This will include the wires/traces and the internal resistance of the capacitor. This allows us to use capacitors between power and ground to filter noise while not having huge spikes of current draw.
Mathematical Point of View
From a mathematical point of view, you can look at the transfer function of the system. The basic ideas of a transfer function comes from the simple electrical science concepts. If you had 2 resistors, you could solve for the voltage between the 2 resistors. In the case of a capacitor or inductor your "resistance" is no longer called a resistance, instead it is called an impedance. Essentially they are the same thing, except impedances typically have imaginary parts to them. In the case of a transfer function, imaginary parts of circuits are frequency dependent. If you solve the math you can find out what you expect the circuit to act like across many frequencies, and then plot it.