Nepotism is not a brand new idea. It is been in practice since the Middle Ages when several Catholic Popes and Bishops elevated nephews and other relatives to become cardinal and to continue the papal dynasty (Quora). The practice continues until today in various fields including business, entertainment and politics as demonstrated in hiring, honoring or awarding contracts. Nepotism is the practice among those with power or influence of favouring relatives, friends and acquaintances, especially giving those jobs (English Oxford Dictionary).
Nepotism is legal to private sector particularly to family-owned businesses but is illegal to public sector because it violates the basic idea of ethics, the equality. It deprives everybody equal chances or opportunities in hiring or promotions because it gives undue advantage to someone who does not necessarily merit this treatment.