Why do some boards have two processors?

The ESP32 has 2 processors. One processor has 2 cores. Normally WiFi is put on one core and the programmer's program is put on the other core. I use, from time to time, the 2nd processor to write code that runs whiles the main 2 core processor is asleep.