It very much depends on the wording of the Will but often the legacy does pass to the beneficiary's children when the beneficiary has predeceased the testator.
"The statutory saving in the Wills Act (ii) has wide-reaching implications. Section 33(1) provides that:
a) ‘where a will contains a devise or bequest to a child or remoter descendant of the testator; and
b) the intended beneficiary dies before the testator, leaving issue; and
c) issue of the intended beneficiary are living at the testator’s death,
then, unless a contrary intention appears by the will, the devise or bequest shall take effect as a devise or bequest to the issue living at the testator’s death’.
For example, Tom gifts the residue of his estate to his two sons in equal shares. The eldest son Peter dies before Tom, leaving two children. Section 33(1) Wills Act operates to ensure that the two grandchildren of Tom (Peter’s children) take Peter’s half in equal shares.
http://www.step.org/doctrine-lapse