To simplify: In biology biological sex in animals most often refers to gonads (sperm or eggs), while gender refers to either (1) their behavior and (2) different variants of a specific biological sex.
Traditionally the difference between sex and gender has been explained as sex being “biological” and gender “cultural”.
Frans de Waal, one of the world’s leading primatologists, do not see it exactly this way. For him gender is the end result of an interplay between biology and culture. This is also the case for apes like chimpanzees and bonobos, and – as he sees – also humans.