For example, you may have a user who belongs to group X, but needs to have access to the few extra options (such as attaching files to posts) given by group Y. You can make X this user’s primary group and make Y a secondary group.
The basic idea here is that if a user is in multiple groups and they specify conflicting permissions, the greater permission overrides. Thus, a yes will always override a no and a larger number will override a smaller number.
Note:
There is a slight exception to this rule. If 0 represents unlimited or no restriction, then it will override any other setting; it really is the greater permission.
Warning:
Be careful when putting a user in a secondary group that you also use as a primary group. You may edit the group and inadvertently give the secondary user more permissions than you originally meant to!