The cavitation occurs when the local pressure drops below the saturation pressure . The items that cause the pressure to drop to that low level downstream of the filter are related to the filter pressure drop which in turn varies by the square of the flowrate . If the flowrate varies depending on what part of the pump's piston stroke , then that pressure can be equalized to a constant pressure by using an inline bladder, implying a tee connection downstream of the filter and a bladder installed.
Another piping element that can cause erosion are sharp contractions /expansions that case a vena contracta to occur- and the typical effective flow area of a vena contracta is 80% of the nominal diameter ( ie 64% of the nominal pipe area) , implying a local drop in pressure below the vapor pressure.
"...when logic, and proportion, have fallen, sloppy dead..." Grace Slick