I don’t think they anesthetize them when they do it. I know they don’t when they do farm animals like pigs and cows.
I have been in on the “vasectomy” of farm animals, and any person wise to the means by which that is done, wants to get the job done long before the creature reaches any size. When a hog gets to about 100 pounds or so, or a young male calf gets to maybe a couple hundred pounds, they can almost make it an even fight. When there are twenty to maybe a hundred or so, it can be a pretty tiring day.