Processes in UNIX are very light, cheap and are born by forking(!).
The forking aspect often eludes users, sysadmins and programmers alike, especially those who are coming from so called "spawn" oriented systems like Windows.
Windows cannot fork, or rather, it can only fork threads (technically it can fork, but this API is beyond reach of WINAPI programs).
I.e. on UNIX, fork is much more similar to thread spawning, than to Windows process spawning. It splits initial process into itself and it's child that is running copy of it's parent and both share same data and history up until the point of the fork (then their respective histories start to slowly but steadily diverge).
As was already said in other answers, this all (cheapness, quickness, lightweightness) means PIDs can appear and go away very, very quickly.
Please understand that traditional UNIX way of writing internet servers is to use one fork per one connection model - this essentially means that one new PID is spawned for each connection.
Just think about it in context of very busy image serving http server: each time image is displayed to a remote client, this means new PID is forked image data is read and sent and then PID is consumed, all happening in very quick succession during fraction of a second. Traditional ftp, but also many lightweight http servers are still being written in such a way to this day.
Another initially weird aspect of UNIX is, that defunct ie. dead processes don't release their PIDs! By the time process of given PID has ended, it has no way to affect the PID still being held in any way. Yet this PID remains allocated and occupies/hogs the system process table.
Why is that? Because under that process table PID record program exit code value and various accounting counters of that process are being held!
This is so CPU and memory accounting programs can read information of their children, even after they have ended.
We call such a defunct accounting record a ZOMBIE.
It means that until specific zombie is processed, its PID cannot be reused (ie several zombies waiting to be accounted for can cause "holes" in case of UNIX systems with very naive linear PID assignement scheme) for newly forking processes.
It is responsibility of process's parent process to "reap" the zombie, ie to consume its accounting information and thus return zombie's PID into the pool of "free PIDs" for other forking processes to reuse.
Given all these facts, even if PID generation is naively linear algorithm preffering to reuse first "unoccupied" PID possible, we see that various system actions like parental zombie reaping, will result with PID never being strictly linearly growing.
On all modern systems completely random PID assignment algorithms can be activated, but OpenBSD is an only system where it mandatory enforced by default.
Thus we should always treat PIDs as completely opaque identifiers.