It's for using when you don't have the degree of intimacy that allows for more personal conversation. The alternative is pretending it didn't happen or simply avoiding the bereaved person.
Yes, this. It's a way of acknowledging somebody's grief and sympathising with them, without going OTT by pretending that their death will make any difference to your life, you being a stranger/not at all close/unconnected to them.
It's deliberately understated and respectful, without trying to presume somebody's feelings or grief processes, which can vary dramatically from person to person.
I agree that 'died' and 'death' rather than 'gone' or 'passed/passed away' can be extremely triggering to some bereaved people, so they're best avoided. On the other hand, some people will think you're somehow trivialising their grief if you don't use those words.
Moreover, you don't always know what relationship the bereaved and the deceased people had. You may assume that they dearly loved each other, but this is often not the case. Supposing a man who was routinely violent and abusive to his wife has died, she may well be feeling mixed emotions, but among them a sense of relief, freedom and a huge burden being lifted, in the way that the widow of a kind, loving, gentle husband would not recognise at all. Frequently, people's relationships behind closed doors are much more nuanced and not at all black and white.
The phrase 'your loss' leaves it brief, open-ended, respectful and neutrally factual, so that the bereaved person can react however they want/need to.