Shutdown processes
releasing resources sensibly
saving ini files and other logs (can hold up shutdown processes if the SSD is busy)
retrieving swapped out OS data from the swap file
...
Do some benchies on your SSD to see if it needs some tlc.
It might be a crappy SSD.