A primary key is a column or combination of columns that identifies one row. The same primary-key value cannot appear twice in a table, and primary-key columns cannot be NULL.
The demo rejects a second id 3 but accepts id 4. If a business value can change, consider a stable identifier and a separate business uniqueness constraint.
When to use
Define one when rows need stable references or updates.