UID User ID, this is a unique number assigned to a particular user. Files that this user creates are stored with that ID number. Root always has a UID of 0. GID Group ID, like User Ids are unique numbers assigned to groups of users. Groups allow administrators to allow a group of users access to a particular system resource.
Users can belong to multiple groups, but always have a default group.
The first field in the password file is the human readable username. The second field is a legacy field, this used to be where the encrypted password was stored, the x denotes that the encrypted password is stored in the shadow file. The third field is the UID, this is unique and duplicates cannot exist. The forth field is the default group ID, generally on Red Hat systems, group 500 is the default users group. The fifth field contains an ID string for that particular user, generally this is the users name.