You can start with the POSIX spec. From there, read about the "controlling terminal" of a process.
But just for example... /dev/tty is how a command like "ssh" can read your password even if its standard input comes from somewhere else:
tar cf - . | ssh dest 'tar xf -'
If ssh decides to prompt you for a password, it will read it from /dev/tty instead of stdin.
Conceptually, /dev/tty is "the keyboard and text terminal". More or less.
Let's say my "terminal-file" of the current session is /dev/pts/1. In such a case, then what's the difference between "/dev/pts/1" and "/dev/tty"? And if they are basically the same, then why "/dev/tty" is used instead of "/dev/pts/1"?
/dev/tty is how a command like "ssh" can read your password even if its standard input comes from somewhere else
Let's say the standard input comes from somewhere else, so let's say we have:
FD 0 <- file
FD 1 -> /dev/pts/1
FD 2 -> /dev/pts/1
How I see it: the fact that the standard input comes from somewhere else doesn't mean that /dev/pts/1 can not be read? The password comes from the keyboard and /dev/pts/1 represents i.a. the keyboard, right? So I still don't see what exactly the purpose is of /dev/tty?
@noci: I know you know the answer, but I don't understand your explanation so I've made this post so maybe other people can explain it to me in a way that I understand it.