A Man-in-the-middle attack (MitM) intercepts a communication between two systems. For example, a Wi-Fi router can be compromised.
Comparing this to physical mail: If you're writing letters to each other, the mailman can intercept each letter you mail. They open it, read it, eventually modify it, and then repackage the letter and only then send it to whom you intended to sent the letter for. The original recipient would then mail you a letter back, and the mailman would again open the letter, read it, eventually modify it, repackage it, and give it to you. You wouldn't know there's a man in the middle in your communication channel – the mailman is invisible to you and to your recipient.
In physical mail and in online communication, MITM attacks are tough to defend. A few tips:
Public-Key-Pins
header (HPKP) can significantly decrease the risk of MITM by instructing browsers to require a whitelisted certificate for all subsequent connections to that website.