SSH
SSH stands for secure shell.
SSH Tunnel
This is the connection/session setup between the SSH client and the SSH server processes after the authentication process is completed. It's the default SSH setup. Nothing special. The tunnel contains multiple channels for different type of data.
Standard IO in SSH
SSH client process will accept all stdin from the user and encrypt and send it to through the ssh tunnel.
SSH Server process will receive the data over SSH tunnel, decrypt and fork a new process to execute the command received. The forked command stdout is written to the SSH server's stdin which is then sent to the client's session.
The client then when receives a response from server, it then routes the response the stdout stream of the client process.
Just understand that SSH is nothing different to HTTP. Just the application layer protocol with different specifications for client and server communication.
SSH Channels
Similar to HTTP2, SSH uses multiple TCP channels using the same TCP session.
There is one main channel for stdin and stdout. There is another channel for stderr and many more for other purposes.
SSH channels are implemented at application layer.
This means, the packets have a special header so that the client can different between different streams of data.
TCP Session
When an SSH connection is established, the same TCP sessions exists between the SSH client and server until the connection is closed manually or if the session is idle for a long time.
How terminals on local machine are connected to bash on the remote machine can be read here.