Why adding SQL Server user to "Perform volume maintenance tasks" improves the speed of database resizing so much?

That's because of Instant File Initialization. In short, SQL Server can take advantage of this privilege for database data files (not transaction log files). What this means is that SQL Server does not have to zero out the data file(s) when initializing.

Without the "Perform volume maintenance tasks" privilege granted to the SQL Service account, upon the database creation SQL Server needs to zero out "test.mdf" and "test_log.ldf".

With the "Perform volume maintenance tasks" privilege permission set, SQL Server only needs to zero out "test_log.ldf". A significantly less overhead, therefore minimized duration for the CREATE DATABASE in your testing.

References
How and Why to Enable Instant File Initialization
Instant Initialization – What, Why and How?


This will not affect .ldf files (log files), at least not according to the MS Article

Why do it? Speed

Why NOT do it? Possible security risk. Someone could hack into your box and possibly read the non-zero'd memory spaces and retrieve that data. Small risk, but still a risk. This is why it is not enabled by default.

Detailed explanation: How and Why to Enable Instant File Initialization