sqlmap uses sqli to read and write files from the local system outside the DBMS.
SQLMap can also give us direct command execution on the remote host if we have the proper privileges.
Read/Write
to read local files, DB User must have the privilege to LOAD DATA and INSERT, to load content of a file to a table and then read that table.
eg: LOAD DATA LOCAL INFILE '/etc/passwd' INTO TABLE passwd;
While we do not necessarily need to have database administrator privileges (DBA) to read data, this is becoming more common in modern DBMSes. The same applies to other common databases. Still, if we do have DBA privileges, then it is much more probable that we have file-read privileges.