How does TRIM work in macOS High Sierra?
MacOS issues the TRIM command to the disk drive controller. From that point on the operating system have no control over the process. What happens is entirely drive dependent.

The most common is that the blocks are marked as unused in a bitmap in the drive, but the contents are otherwise left alone. In order to prevent the possibility of forensics, you’ll need to send a secure erase command instead.

Depending on the drive, that will typically either erase the blocks or throw away an encryption key - or possibly both (typically on Intel drives). The end result is making it impossible to retrieve the data that was previously stored in those blocks.