Why do McDonald's and KFC have two restaurants?

If it is just a door, then with their passenger flow, that door must have few defects. Keep on-off, on-off, the air conditioning or heating of the restaurant will continue to lose. But because it is two, this problem is solved. When you open the first door, there is another door inside to stop the loss of air conditioning or heating, but when you open the second door, the first door closes automatically, so the air conditioning or heating can't get out.