The two generals' problem is sort of like a game that two people can play to agree on something together. Imagine that two generals, both in charge of a large army, want to work together to attack a city. But, they're far away from each other and can't talk to each other directly. They want to make sure that they coordinate the attack perfectly, and don't attack at different times or fight with each other instead of the enemy.
To make sure this doesn't happen, they have to find a way to agree on what time they will attack. The two generals start by sending a messenger back and forth between them. The messenger can carry a message that says either "attack now" or "don't attack now." First, one general decides that they will attack either now or at some future time. Then, he sends the messenger to the other general. The other general then decides if he will attack now or later, and sends this message back.
The problem is that their messenger is slow and the generals are worried that the messenger will take so long that by the time the message gets to the other general, it won't make sense anymore. For example, the first general says "attack now," but the messenger takes a long time and the second general can't attack until it's too late.
To solve this problem, the two generals need to come up with a way of sending messages quickly, so they can make sure they both agree on the same thing. They also need to figure out a way to make sure they both know they've agreed, so they don't end up attacking each other by accident.