What is the purpose of putting a capacitor on the primary side of a step-down transformer?
In addition to Autistic's correct answer, the value of C9 (X rated) is a compromise between consuming excessive AC current at 60&nbsp;Hz while suppressing the noise voltage spikes by about 3&nbsp;dB to 6&nbsp;dB at the transformer primary if power is cut off when the 60&nbsp;Hz sine wave is at or close to peak current. C9 does NOT behave like a MOV or TransZorb, but an active noise filter. When the power is cut off as mentioned above there is a burst of noise, the back EMF from the transformer. This can send substantial RF noise into local air space as well as increase arcing of the switch contacts.

C9 consumes about 150 µA of current at 60&nbsp;Hz (18&nbsp;mW at 120&nbsp;VAC), not enough to heat up anything. If C9 were large enough to suppress most of the noise burst (say 0.33&nbsp;uF), it would consume 15 milliamperes of current and  1.8&nbsp;watts of reactive power. The design engineer was being careful about the power budget vs. its ability to absorb a useful amount of RF noise, likely based on oscilloscope readings of the primary voltage when the switch is turned off.

Also if C9 had a high value then it could cause a brief current spike when the power is turned ON. Keeping C9 at a low value avoids this problem as well as the extra space and cost of a large X rated capacitor.