For gregarious species such as domestic cattle, the social environment is a very important determinant of their welfare and fitness. Understanding the complexity of cows' relationships can assist the development of management practices that are more integrated with the cows' social behavioral processes. The two aims of this study were: (1) to determine the dynamics of affiliative relationships, as indicated by allogrooming, by means of stochastic actor-oriented modeling, in dairy cows during early lactation; (2) to explore the underlying processes and the individual attributes, such as age, social rank and reproductive state, that could shape network pattern changes in grooming contacts between individual. We observed the allogrooming behavior of a dynamic group of 38 dairy cows for 4 h per day for 30 days. Using stochastic actor-oriented models, we modeled the dynamics of weekly contacts and studied how structural processes (e.g., reciprocity, transitivity, or popularity) and individual attributes (i.e., age, social rank, and reproductive state) influence network changes. We found that cows tended to groom individuals that had previously groomed them, implying a possible cooperation. Cows that groomed more actively did not appear to have a preference for specific individuals in the herd, and in return, tended to be groomed by fewer cows over time. Older individuals groomed more cows than younger ones, indicating that allogrooming could be related to seniority. Cows groomed mainly individuals of similar age, suggesting that familiarity and growing up together enhanced social grooming. Over time, cows with higher social rank were groomed by fewer cows and individuals recently reintroduced to the group groomed more herdmates. The study of social network dynamics can be used to better understand the complexity and non-linearity of cow relationships. Our findings, along with further research, can complement and strengthen the design of improved management practices that are more in line with the natural social behavior of cows.