CCC 1576 Since the sacrament of Holy Orders is the sacrament of the apostolic ministry, it is for the bishops as the successors of the apostles to hand on the “gift of the Spirit,”1 the “apostolic line.”2 Validly ordained bishops, i.e., those who are in the line of apostolic succession, validly confer the three degrees of the sacrament of Holy Orders.3

1 LG 21 § 2.
2 LG 20.
3 Cf. DS 794 and Cf. DS 802; CIC, can. 1012; CCEO, can. 744; 747.