What does a primary key actually guarantee, and what does it not?
A primary key guarantees three things. The values are unique — no two rows can have the same key. They are not NULL — every row has a key, because a row with no identity is not a row you can point at. And they are minimal — the key contains no column that could be removed without losing the ability to identify a row. In practice the third point is what makes a composite key a design smell: if one column of the key determines the rest on its own, that column should be the key and the others should be ordinary columns.
What it does not guarantee is equally important. A primary key says nothing about the order of the rows, nothing about the meaning of the key value, and nothing about whether the key will still be there next year. It is not an ordering guarantee, it is not a business rule, and it is not immutable. Updating a primary key is legal and sometimes necessary — but any table with a foreign key pointing at it will have to cascade that change, or the update will be rejected.
Two consequences follow from the uniqueness guarantee. The engine can use the key as the physical identity of the row — in SQLite an INTEGER PRIMARY KEY is an alias for the row's own identifier, and in MySQL InnoDB the primary key is the clustered index, meaning the whole row is physically stored in key order. That is why a random UUID primary key is a genuine performance problem in MySQL: every insert lands in a random page of the index, causing page splits and write amplification.
And because the key is unique, it is the natural target for a foreign key and the natural identifier to pass to another system. It is also the one thing you should never renumber casually, because every external reference, every cached id and every log line that mentions it becomes wrong.