If you run them both, you'll see that the first one shows only the direct groups memberships (which is usually fine if you only want to check which groups they are directly members of). The second script will show you the direct groups they are members of (as shown in the Member Of tab), as well as the groups that contains *those* groups as well.
For example, if Joe Smith is member of HR, it will show that, but it will also show Resources, if the HR group is a member of the Resources group.