We argue that grooming is a commodity that female primates can trade, either for itself or in exchange for other services (sensu biological markets theory) and that the decision to do either will depend on the degree of competition within a social group. We test this using data from four chacma baboon troops, living in two populations that differ markedly in the degree of contest competition. As predicted by the predominance of grooming dyads in which females are closely ranked there was, in all four troops, a positive correlation between the time invested by one partner and that by the other. In addition, as predicted, the allocation of time was more closely matched in troops where grooming could not be exchanged for anything else. In troops where resource competition was high, we found in one of two troops a positive relationship between rank distance and the discrepancy in time allocation, with the lower ranking of the partners contributing more grooming.