The reason you defrag is so that all of the blocks that belong to a file are all lined up, so that when the drive rotates it can pick up as many blocks as possible without having to "seek" or move to another location. If the data is all spread out the head will have to move around a lot more to find the data it needs, causing a higher latency as the drive waits for the head to move, and then for the platter to spin to the location of the data. SSDs work more like ram, where where it takes roughly the same amount of time to resolve and fetch from ANY memory location. This sort of breaks down when you have a very large number of random requests, as the drive becomes bottle-necked by the controller, and how many IOPS it can preform, where as sequential data does not need to resolve new addresses, so data will be transferred at the maximum rate if possible.
As for why defragging is bad for SSDs, those blocks do have a finite number of writes, and on older drives with older controllers those blocks could wear out relatively quickly, so unnecessary writes should be avoided. Newer drives use various technologies and algorithms to ensure that data is written evenly to all blocks so that some do not wear out faster than others... in other words it places data all over the place, which is the EXACT OPPISITE of what defragging does.
Check out this article that shows that after trying several defragging programs, none showed any performance gain on SSDs.
http://www.pcworld.com/article/2047513/fragging-wonderful-the-truth-about-defragging-your-ssd.html?page=2
Also as a side note, defragging is only marginally useful now that we have multiple terabyte drives and modern operating systems. Data is generally written sequentially until the drive starts to get full, usually around 85%... and most people don't fill these large drives. On top of that windows 7/8.1/10 automatically select an optimized location for the data to be stored and move other data to make room if needed. In other words it will clear a space so the data being written can be written continuously and sequentially, meaning that when you go to defrag, the work is more or less already done.
Source: I'm a computer engineer