Within-group behavioral variation promotes biased task performance and the emergence of a defensive caste in a social spider