Reading the book by Uresh Vahalia, Unix Internals, I could understand exactly what is the concept behind real and effective UID and GID. I immediately thought of blogging it for reference.
The effective UID and effective GID affect file creation and access. During file creation, the kernel sets the owner attributes of the file to the effective UID and effective GID of the creating process. During file access, the kernel uses the effective UID and effective GID of the process to determine if it can access the file.
The real UID and real GID identify the real owner of the process and affect the permissions for sending signals. A process without superuser privilege can signal another process only if the sender’s real UID matches with the real UID of the receiver.
Child inherits the credentials from the parent. since parent-child share the credentials, they can signal each other. CMIIW.