GLM always treats variables as continuous and as coming from a normal distribution. It doesn't use a Z test. The Z test assumes that you have a known variance, whereas a t test, and linear models in general, uses the sample variance as an estimator. In answer to your question, "how does it handle categorical/binomial dependent variables", the short answer is: It ignores the fact that the variable is categorical or binomial. All responses are treated as continuous. For binomial responses, we have seen that this isn't too bad in a lot of cases, because we can sort of rank a yes/no response. For true categorical variables, such as product brands, or various politicians, this can't really be done, and GLM is likely to give bad results.
SAS has other procedures that are more appropriate for these sorts of distributions--LOGISTIC, GENMOD, GLIMMIX--that use the tools of linear models and recognize the distribution of the outcome variables. But these are "newer", and utilize methods that usually are not covered in intro stat courses. Consequently, GLM or TTEST are the tools that people have seen. And to quote a famous proverb, "When the only tool you have is a hammer, every problem looks like a nail." People go around hammering--sometimes the results aren't so bad, sometimes you break the crockery.
... View more