FTP is a protocol that allows files to be transferred between computers connected to the Internet or with different operating systems. It uses two TCP ports, with port 21 for sending commands to the FTP server and port 20 for transferring data. The FTP server listens on port 21 for connections and commands from clients, then uses a separate data port to send and receive files and data.