You missed the second part: if the entity isn't new, merge
is called. merge
copies the state of its argument into the attached entity with the same ID, and returns the attached entity. If the entity isn't new, and you don't use the returned entity, you'll make modifications to a detached entity.