As the name suggests, setup hooks hook into the generic builder of the stdenv and modify it.
wrapGAppsHook*
family, specifically, replaces every executable in $out/bin
and other similar directories with a program that sets some environment variables (as mentioned in the reference) and then executes the original program.