As the code loops through the arrays at the same time (4 & 5) in your example it must loop through the larger of the two arrays to make sure it captures every element in both arrays.
If it looped through the smaller array capturing one element from each of the arrays, you would only end up with eight items in the final array. The IIF statement above determines the largest of the two arrays so that the loop will capture every element from both arrays.
So the higher array (5) captures 1 to 4 from one array and 1 to 5 from the other.
It is the below part of the code that creates the resized array to hold the new alternated array:
ReDim tmpArr(upper1 + upper2 - 1)