$('<div/>').addClass('sample-piece');
create a new div
element and add class sample-piece
to it. The new created div is not in the dom tree at that time, you may need to append it to some other element.
$('div').addClass('sample-piece');
add class sample-piece
to the all the div
elements in the dom tree.
summarize:
$('<div/>')
creates a new div
element.
$('div')
selects all the div
elements.