WordPress multisite proper prefix attribution

It is using a DB level “auto increment” flag on the base site blogs table. Basically, when a new record is inserted into the table the blog id number is automatically created with no discrete SQL — it just “happens”.

The database keeps an internal control structure for this that you don’t have direct access to. Even if you delete a row that internal counter does not change and the next insertion is simply +1 from the last one. Unless you turn off auto-increment for that primary key on the table, which would be a bad thing to do.

See this answer for additional details.

WP gets the new blog id from the insert_blog() call, which does not seem to allow the caller to specify a suggested or desired id number. You’d either need to write your own version of the functions that effect the instantiation of a new blog (not recommended), or try to live with this default behavior (recommended).