I know that permalinks involve rewrite rules and they are somehow updated by Dashboard > Settings > Save changes. Sometimes this must be "refreshed" when you add plugins the create new re-write rules... but usually the .htaccess file doesn't change. So what is that button actually doing?
I know it tries to re-write the .htaccess file (if it has sufficient permissions on the server), but does it do something else? Is there a cache or database record somewhere as well?
For reference, here's the codex page for permalinks. (It only talks about .htaccess)
It also tells WordPress to write the form values to the options table for the following options:
permalink_structure
category_base
tag_base
The default permalink structures denoted by radio buttons simply have the structure pre-formatted for the user, so the Day and name option for example is simply written into the database as
/%year%/%monthnum%/%day%/%postname%/
The Default option is written into the database as an empty string to indicate not to use pretty permalinks.