SSDs have very fast access times for data stored in any part of the drive and do not need to defragmented but they need to be sent a TRIM command which tells the SSD controller to erase unused blocks which are no longer in use, so that when the time comes to actually write new data to those blocks, performance isn't affected.
During active use, hard drive performance suffers due to file system fragmentation which notably slows down the access time. Out of the box, Windows 10 performs disk defragmentation once a week for hard drives and SSD TRIM operation for SSDs.