Assuming you're using NT authentication:
For authentication:
1) SP uses AD to identify what security groups the connecting user
belongs to.
2) SP checks the SP resource user permissions against the AD user and
the group list from step 1 for a match.
3) If there's a match, SP grants the user access as specified in the
permissions list. (I'm not sure what happens if there are multiple
matches. This may be the source of the 'never use nested SP groups with
AD groups' bug.)
For profile creation:
1) SP checks to see if the authenticated user who is connecting user has
a profile. If not, it creates one.
2) OPTIONAL: If you choose to import profiles from AD, scheduled or
otherwise, it sets up new profiles as it finds users in AD who do not
have a profile. I don't believe it ever deletes old profiles.