WordPress attempts to update the .htaccess file when you change permalink settings, activate caching, or enable security features. The core writes rewrite rules to control URL structure and server behavior.
If the file is not writable, WordPress stops the operation and displays an error. The failure originates from the operating system denying write access to the file.