Basically it grabs all of the id's from your database and populates links for google of what content is where; it assists in the discovery of new urls for google.
Then you tell Google that that is your site map? If you have tens of thousands of posts, wouldn;t that file get very big? Or does it not actually list every single thread?