It is due to Y capacitor which is connected across the primary and secondary of the high frequency transformer to provide a low impedance path dor the rf noise to ground via the mains.
It has a very limited capacity, hence does not allow much mains frequency current to flow (you may feel pricking sensation on sensitive skin like back of hand or face but no shock). However NCV can be triggered because it detects electric fields, not current.