Execute the function, and what is in between the curly-brackets, for each of the DOM elements that matches the selector. The keyword 'this' refers to the current element the loop is dealing with.
The function specified receives an iterator as argument by default, represented in this example here as 'i'.
$("div img").each(function(i){ this.id = this.id + "_" + i; });
To break out of a jQuery each loop you use 'return false' like you would use the 'break' command in a usual javascript loop:
$("div img").each(function(i){ if (this.id == 'whatever') { return false; } });