It's just an auto incrementing column in the MySQL database. MySQL is using an internal counter, it's nothing to do with WordPress.
http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
Update
To reset your post ids, run the following (substituting in your tablename):
ALTER TABLE tablename AUTO_INCREMENT = 1