Activity rhythms in animal groups arise both from external changes in the environment, as well as from internal group dynamics. These cycles are reminiscent of physical and chemical systems with quasiperiodic and even chaotic behavior resulting from "autocatalytic" mechanisms. We use nonlinear differential equations to model how the coupling between the self-excitatory interactions of individuals and external forcing can produce four different types of activity rhythms: quasiperiodic, chaotic, phase locked, and displaying over or under shooting. At the transition between quasiperiodic and chaotic regimes, activity cycles are asymmetrical, with rapid activity increases and slower decreases and a phase shift between external forcing and activity. We find similar activity patterns in ant colonies in response to varying temperature during the day. Thus foraging ants operate in a region of quasiperiodicity close to a cascade of transitions leading to chaos. The model suggests that a wide range of temporal structures and irregularities seen in the activity of animal and human groups might be accounted for by the coupling between collectively generated internal clocks and external forcings.