The first one, cap across diode limits any flyback from the diodes inductance. The second one cap and resistor is a soft suppression, this stores the flyback energy in the capacitor rather than dumping large current into the supply. This could be used for very large coils which would make the...