Raag and Vairag center around Sansar.
Attachment ( Raag ) or conscious detachment ( Vairaag ) surrounds objects, people, and Samsara situations.
If I love to eat and I find myself dragged to eating unhealthy foods, that is Raag.
And if I fast for a few days, consciously avoiding the same foods, I’m practicing Vairaag.
Both are mental activities ( Ego ), and the mind ( Ego ) cannot take you to God.
The third state, Vitaraag, is connecting with the consciousness, getting engrossed in it, and realizing that in doing so, the mind has lost its desire to run after the same foods, even without trying.
Vitaraag is the state at the soul level ( beyond the mind ), and it comes only with Sadhana.
So, in a way, detachment is not the most appropriate word for such a state; rather, dispassion will be a better word.
When detachment is not an act but a result of inner sadhana, it becomes dispassion.