The reason could be the .item
elements are added dynamically
When you use $('.item').click(..)
it binds the click handler only to those elements which exists in the dom at that moment of time, so if an elements is added after this statement is executed the click handler will not will attached to the new elements.
when you use $(document).on('click','.item',function() {});
to register click event handler, it makes use event propagation to work. In the dom event structure an event from an element will get bubbled up to the document object. id if a element is clicked the click handlers attached to it and its parent elements will get triggered unless the event propagation is prevented. So in this method the click eveht handler is registered to the document
object, so when the click event from an element is bubbled upto the document object it tests the events source element(or its parent) with the passed filter in this case .item
and it is true then the handler is executed