The man page for
zpool trim
[1] provides a good explanation. Basically TRIM is used to discard unused storage blocks in the filesystem. This improves SSD performance and lifespan as it does not need to continually delete old blocks on every write. It also allows thinly provisioned storage to reclaim space that is unused by the guest operating system.
There are two main differences here. The first and most obvious is that
autotrim=on
allows trim operations to run automatically in the background while
zpool trim
must be called manually. The second is that
zpool trim
reclaims every free block it finds, while the autotrim feature waits until a large enough range of blocks have become free before it trims, for the sake of optimization [2].
The zpoolprops man page [2] also mentions that autotrim can put significant stress on the underlying storage devices, depending on their quality. With this, it also implies that for lower end (non-enterprise grade) devices, running
zpool trim
periodically could be the better option. You could, for example, set up a cronjob to run
zpool trim
as often as you feel appropriate for your system and at times of lower activity.
[1]
https://openzfs.github.io/openzfs-docs/man/8/zpool-trim.8.html
[2]
https://openzfs.github.io/openzfs-docs/man/8/zpoolprops.8.html?highlight=autotrim