Dokuwiki distinguishes between files which are supplied with the distribution and files which are local to the user. Most of your settings go into local.php, and that is not overwritten. Similarly your acl and user authorization files (otherwise every time you update your Dokuwiki, your users would have to register all over again and you would have to reset t heir permissions). The same thing is true of conf/userstyle.css. There are other files which also will not be overwritten, here I am thinking of localized language files (See
https://www.dokuwiki.org/localization).
A new distribution will contain an updated template directory but it will not overwrite files which you have created, if you have created your own style sheet. But the latter has to be assigned in style.ini (which I believe will be overwritten, so it's a good idea to back that up). See:
https://www.dokuwiki.org/devel:css?s[]=style.css