Generating subarrays

I am not understanding the execution of code of generating subarrays