A residuary devise is when the residue of one's property is left to someone. (i.e., everything not otherwise devised)
If all residuary devises lapse, the heirs of the testator take the residuary devise by intestacy.
If part of the residue lapses, that portion is inherited by the heirs by intestacy. It is not devised among the remaining devisees. (This does not mean class gifts however.)
(This is possibly the least intuitive rule in wills.)