Jeez fellas, you must be bored. OK, this is a simplified version based on how I assume it must work rather than any insider knowledge.
Every comment is stored on a database with a unique id number, and then each thread has a list of the id numbers of the comments that belong to it, and the position of the comment in the thread. When you load page one of the thread it goes off to the database and says, give me the id numbers of comments in position 1-40 on thread number 12345. So the database comes back with 236532, 236732, 237433 etc, then goes off to the comment list to find out what these comments say, and puts the text of each comment on the page.
Comments
Welcome to married life my friend!
Every comment is stored on a database with a unique id number, and then each thread has a list of the id numbers of the comments that belong to it, and the position of the comment in the thread. When you load page one of the thread it goes off to the database and says, give me the id numbers of comments in position 1-40 on thread number 12345. So the database comes back with 236532, 236732, 237433 etc, then goes off to the comment list to find out what these comments say, and puts the text of each comment on the page.
With me so far?
Like Nigel Tuffnels amps went up to 11 in Spinal Tap..easy if you ask me.