Both methods can pass detached object as parameter, but if there's an object in the context with the given identifier, the first method throws an exception. Read
Update the persistent instance with the identifier of the given detached
instance. If there is a persistent instance with the same identifier,
an exception is thrown.
public void update(Object object);
The second method doesn't throw an exception because it loads not existing object by its identifier to the context, update it, and returns to the caller.
Copy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
public Object merge(Object object);