Most of the people mourning the death of Queen Elizabeth II were not close to her—research can shed light on the nature of their grief