Merge() is used to re-connect an Entity with the persistence session.
As an example, assume you have an Entity class named User.
In your
EJB, you create a new User:
User user = new User();
This object is not associated with the persistence
unit yet.
You then set some values:
user.setFirstName("first name");
You then associate it with the persistence unit, using the persist() method:
context.persist(user);
Now, the persistence unit will manage the User object, saving it to the database when it is time (not necessarily right away).
Let's say you send this User object to the web client, so the web application can give it to the user to edit. This will disconnect it from the persistence unit. When the application sends the object back to the EJB, you need to re-associate the (currently) disconnected User object with the persistence unit. You do this using the context.merge(user) method.
When you call merge(), it will re-associate the object with the managed User object, and update the values to those passed in the user-edited User object.
At some later time, the persistence unit will take care of applying the changes to the database record.
So, persist() is used for associating new Entity objects with the persistence unit, and merge() is used for re-associating disconnected (but existing) Entity objects with the persistence unit.
By the way, this is all explained very well in the book: EJB3 in Action from Manning Publications.