Start here. This is the direct spoken answer to practice first.
Overview
Most surprising JPA behavior becomes easier to explain once the entity's state is known.
A new or transient entity is not associated with a persistence context. A managed entity is tracked and participates in dirty checking. A detached entity has identity but is no longer tracked, and a removed entity is scheduled for deletion. persist makes a new entity managed. merge copies state from a detached or new object into a managed instance and returns that managed instance; the object passed to merge does not itself become managed.