In this specific case of making a donation large enough to build classroom space / hire professors , the person is increasing the teaching capacity of the school by more than 1, allowing them to attend in exchange helps everyone.
Harvard's undergraduate size is absolutely not limited by funding.