Who is asking
Files carry permission bits, but the kernel does not check names. It checks numbers: a process’s credentials against an inode’s owner and group. A UID identifies a user; a GID a group. Names live in /etc/passwd and /etc/group; password hashes in /etc/shadow. UID 0 is root and bypasses ordinary permission checks.
A process carries several IDs: real UID (who ran the program), effective UID (whose rights apply now), and saved UID (what it may switch back to), plus the analogous GIDs and a list of supplementary groups. Login shells start with real = effective = saved. Libraries and daemons that briefly need privilege use seteuid and should drop back as early as possible.
Exactly one permission class applies, chosen in order: root, then owner, then group (including supplementary GIDs), then others. Only that class’s three bits matter — belonging to the group does not add the “other” bits on top.