From Latin 'legatum' (a bequest), from 'lex' (law) — something transmitted under the authority of law between generations.
Something handed down from an ancestor or predecessor; a bequest of property or money by will; a lasting effect or consequence.
From Medieval Latin 'lēgātia' and Old French 'legacie,' from Latin 'lēgātum' (a bequest, thing bequeathed), the neuter past participle of 'lēgāre' (to appoint by a last will, to bequeath, to send as a deputy). The root is 'lēx,' 'lēgis' (law), from PIE *leǵ- (to collect, gather, read). The underlying idea is of something 'laid down' or 'bound' by law — a formal declaration made binding by legal instrument
In computing, 'legacy' is used pejoratively to describe outdated systems still in use — a 'legacy system' is inherited from the past and hard to replace. This modern slang perfectly captures the original Latin sense: something left behind by a predecessor that successors must deal with.