If I understand the question correctly you are asking why a primary key *constraint* is needed when the key values are generated automatically. In practice most native DBMS key-generator features can be bypassed or overridden, or the generated value may get updated after it is generated. Under some unusual circumstances a key generator may get reset so that it produces duplicate values. For these reasons the key-generator by itself won’t necessarily guarantee uniqueness.
Adding a primary key constraint not only guarantees uniqueness, it also provides information to the query optimizer (if one exists) to help improve query performance and the presence of a constraint shows database users what the key attribute is. Creating a constraint usually means an index is also created, and normally it’s desirable to have an index for key columns. Data management software tools tend to rely on constraints to identify keys – such tools may not be able to use a generated attribute as a key unless it has a constraint on it.