Why execute the_post()?

It is necessary to execute that function if you want to use the template functions such as the_title() & the_permalink(). You should not use it if you aren’t using those kind of functions but for the themes it’s generally recommended to use these functions since they automatically ensure that all wordpress filters are being applied. This functions modifies the global variables but still it’s safe to use as long as you also reset the postdata after finishing the query.

Iterating the array results is useful if you’re only interested in raw data.