understanding php curl_multi_exec

I’m trying to understand curl_multi_exec. I’ve copied a piece of the manual example here. So I’m wondering, how does it work? The first loop sends the http request I guess? But it then it is followed by a loop inside a loop using functions with seemingly undocumented flags..