As for your first question, I'm not sure why they created two Animal objects.
As for the loop, basically, it is meant to be a simpler syntax for iterating over a set of objects. You can think of the colon as being like the
word "in", so it is saying something like "for each Animal in a, do this". For an array like this, it is shorter than writing something like the following.