Different types of hardware.
A pty is a pseudo-teletype, a sofware presentation of the application side of a terminal (called the slave). The other side (called the master) controls how data is sent to, and received from, the terminal.
In ssh, the client ssh just sets the terminal in a "raw" mode (no echo, all characters sent), and any data received from the remote connection is just sent to your local terminal. On the remote side, sshd (after authentication) will set up the master side and begin passing your keyboard data to the master interface. Any data received from the the master is put onto the network connection and passed to the ssh client to put on your terminal.
The slave side of the pty used by the remote sshd service is attached (after authentication) to an interactive shell (the command interpreter).
To the shell program, the pty looks exactly like a terminal.
There are two kinds of TTY - a real serial line (the COM1/COM2 of DOS), or the tty emulated by a video card.
In the emulated tty of the video card, what would have been the master side of the pty is directly connected to pass data to/from the video card.
In the serial line, what would have been the master side, is directly connected to the serial interface.
The serial line is secured by physical controls - hardware length, shielding, physical containment. The pseudo terminal is secured by software- ssh encrypts/decrypts communication with the sshd server, which decrypts/encrypts data and passes it to the master pty control interface.