Preening. they may be in the same family group. A common way to enhance bonding among the group.
This behaviour is also seen in other bird groups, e.g. Black -faced Spoonbills.
But I have never seen this behaviour in egrets and herons (they may have stronger characters)