For a detailed explanation of a similar PROC MEANS step, see the example "Identifying the Top Three Extreme Values with the Output Statistics" in the documentation for the MEANS procedure in SAS Procedures Guide.
proc means data=Charity descendTypes charType noprint;
class School Year;
var moneyRaised;
types () School year;
output out=top3list sum= mean=
idgroup ( max(moneyRaised) out[3](moneyRaised name school year)= )
/ autoname;
run;