Diff. between for loops

What is the difference between these two loops?
for(int i=0;i<arr.size();i++) and for(auto i : arr)

The first one is the simple for loop, while the second one is the enhanced or the range-based for loop.
Both function in the same manner. We usually use the first one normally.