Heirs who have a direct relationship with the deceased will always get a share in the estate, these are six relations: Father, Mother, Husband, Wife, Son and Daughter.
Among other heirs (e.g. grandparents, grandchildren, siblings etc.) some can block others from receiving a share. This is called حجب , specially the case where a heir goes empty is called حجب حرمان.
A heir blocks another heir who is related to the deceased through him. e.g: the father blocks the grandfather, a son blocks his children (grandchildren), a brother blocks his son (nephew).
Closer relations block distant relations. e.g: a son blocks the siblings, the mother blocks the grandmothers (including paternal grandmother), a brother blocks an uncle.
For further details and exceptions refer to: الموسوعة الفقهية and الفقه الإسلامي وأدلته