Understanding behavioural dynamics in pigs is important to assess pig welfare in current intensive pig production systems. Agent-based modelling (ABM) is an approach to gain insight into behavioural dynamics in pigs, but its use in applied ethology and animal welfare science has been limited so far. We used ABM in a case study on tail biting behaviour in pigs to explore the use of ABM in gaining more insight into emergent injurious pig behaviour and related welfare issues in intensive production systems. We developed an agent-based model in Netlogo 5.1.0 to simulate tail biting behaviour of pigs housed in conventional pens in groups of 10. Pigs in the model started as neutral pigs (not involved in biting incidents), but could change into a biter, victim, or both biter and victim. Tail biting behaviour could emerge when pigs were unable to fulfil their internal motivation to explore. The effects of a redirected exploratory motivation, behavioural changes in victims and preference to bite a lying pig on tail biting patterns were tested in our model. The simulations with the agent-based model showed that coincidence in development of a redirected exploratory motivation can lead to tail biting behaviour in pigs and can explain the strong variations in incidence of tail biting behaviour observed in conventionally housed pigs. Behavioural changes in victims and preference to bite a lying pig seem to be of minor importance in the causation of tail biting patterns. The behavioural time budget of a pig might be an important factor in predisposing pigs to or preventing them from becoming a tail biter or a victim. ABM showed to be useful in analysing behavioural dynamics and welfare issues. An advantage for ABM in applied ethology is the availability of data from empirical studies.