Caps rated as X1(440vac?), X2(240vac) are specified (and listed) are 'guaranteed'/certified to fail either totally open, taking it out of the circuit, or totally shorted, which would trip a breaker. Because they can fail shorted, they are used across the line, from hot to neutral. These are used to address differential/normal mode noise.
Caps rated as Y1,Y2 are specified .... to fail totally open. This means they may used also from Hot/Neutral to safety ground as they will not nominally put mains voltage to a grounded chassis, even if they fail because they will (hopefully) only fail open. These are used to address common mode noise.
Indeed, the characteristics (frequency vs impedance, etc...) of the cap(s) can be subjectively perceived (I will inevitably rue this statement). Personally, I only use 'rated' caps for mains use, and think the proper combinations can meet my needs.
Mains X & Y will come in ceramic (inexpensive and mediocre performance) and metalized film (Mylar or Polypropolenne) or metalized paper. I've not found foil caps certified for these uses, I assume because they lack the self healing characteristics of metalized caps.