People think of legacy as a binary input: is the applicant a child of parent (grandparent in some cases) who went there. It is far more graduated, and reflects the previous donations of the parent who went there. Consider three different alumni along a continuum:
1) An affluent alum who has already given generously, been active in alumni activities (fundraising, etc.), arranged internships for students, is employed in an industry (finance, law) where connections are extremely important, has been bringing their kid to reunions for years, and who may have been a legacy admit themselves many years ago.
2) An affluent alum who has not given generously yet but has some potential (admissions will have a least an estimate of amassed wealth) , is in engineering/software where connections are important but not as crucial, has some connection to the institution, comes to reunions, but does not have a track record already of generous giving.
3) An alum who is not affluent, works in education or public service, who has not had much to do with the institution since graduating, but has fond memories of the institution.
These would all three be considered "legacy" applicants but it is certain that the admissions office would regard #1 as a much better "fit" for the institution than #2, and #3 may as well be someone with no connection to the campus.