Animal behavior varies across different timescales. This includes rapid shifts in behavior as animals transition between states and long-term changes that develop throughout an organism's life. This review presents the contributions of sex differences, individuality, and internal states to behavioral variability in the roundworm Caenorhabditis elegans. Sex is determined by chromosome composition, which directs neuronal development through gene regulation and experience to shape dimorphic behaviors. Genetically identical individuals within the same sex and reared in the same conditions still display distinctive, long-lasting behavioral traits that are controlled by neuromodulatory systems. At all life stages, internal states within the individual, shaped by external factors like food and stress, modulate behavior over minutes to hours. The interplay between these factors gives rise to rich behavioral diversity in C. elegans. These factors impact behavior in a sequential manner, as genetic sex, individuality, and internal states influence behavior over progressively finer timescales.