The ringing caused during the DCM period of the flyback caused due to leakage energy of inductance with capacitance of the MOSFET will cause voltage spikes and oscillations at LX node.
A snubber resistor and capacitor combination is used to absorb any leakage energy that causes ringing when the switch is turned off.
The capacitor dissipates the stored energy into the resistor throughout the switching cycle.
The power dissipated across the resistor will be of a few mW as it is averaged over a switching cycle.