Its a feeling of sympathy
People would say my condolences or something like that to show that they sympathize you