Kishan25 :
Ive read that when you delete something from a hard drive it just gets over written. Is this the same for an SSD?
Others have answered your second question so I'll tackle this one.
When you delete something from a HDD, the computer could overwrite all the file data with zeroes. That would take a lot of time though, and isn't really necessary. Instead they just change the first byte of the file to a value that says, "this space is empty." The next time the computer is looking for space to write a file, it checks the first byte, sees it's marked as empty, and writes the file there. Writing this new file is what actually erases your old data. As you can imagine, if the disk is mostly empty, it can be a long time before the space used by the deleted file is actually overwritten. This is what makes it possible to undelete files.
SSDs differ from HDDs in two important ways.
1) The location of the file is not a fixed value. On a HDD, the file is (typically) written in 4k chunks. The end of each 4k chunk contains the location of the next 4k chunk. So if none of the deleted file's data has been overwritten by new files, and you can find that first 4k chunk, you can follow it to the next 4k chunk, read that and follow it to the next 4k chunk, etc. until you've recovered the entire file.
On a SSD, the location of the file is just an entry on a table. It's done this way because you can only write data to each memory cell of a SSD about a thousand times. If you bought a new SSD and immediately wrote a huge movie to it, then left that movie untouched for years while you continued to use the drive normally, the memory cells holding that movie would only experience one write while the other cells experienced dozens or hundreds of writes. This decreases the effective lifespan of the SSD.
To address this problem, the SSD manufacturers use something called wear leveling. The SSD detects that the cells holding the movie haven't been used as much. So it copies the movie to different cells, and frees up the used-once cells so they can be used more. In this way, all the memory cells in the SSD are used roughly the same amount (their wear is leveled), maximizing lifespan.
But if you moved the movie, how does the computer find it again? The SSD tricks the computer. It says the file is at location X. But then it has an internal table where virtual location X maps to physical memory cell y. When it runs the wear leveling and moves the movie to memory cell z, it just updates the table so it now says virtual location X maps to physical memory cell z. That way the computer can still request the data at location X, and the drive can deliver that data even though its not stored in the same physical memory cell anymore.
Now what happens when you try to undelete something from the SSD? If no wear leveling has occurred, then you can undelete just like with a HDD. But if wear leveling has occurred, at the point where the SSD would update the table so it says location X maps to memory cell z, it notices the file is marked as deleted. So there's no point updating the table since the file isn't supposed to exist anymore. The table doesn't get updated, and now the only way you can retrieve that 4k chunk of data is to
read every single 4k chunk of memory space on the SSD and try to find one which seems to be the next 4k chunk in your file. This isn't impossible, but it's pretty close to it.
2) In a HDD, you can overwrite a 1 with a 0, or a 0 with a 1. You can't do that with a SSD. To write new data with a SSD, you have to first set the memory cell back to an erased state. That is, you have to go 1 -> erased -> 0, or 0 -> erased -> 1. (If you're an electrical engineer, it's basically an EEPROM.) When you deleted the file from a HDD, it just changed the first byte of the file. When you deleted the file on the SSD, it read the first 4k chunk, changed the first byte, wrote that new 4k of data to new memory cells, then updated its internal table so the first 4k of the file was pointing to the new memory cells.
So what happens to the original 4k of memory cells which held the file's original beginning? Remember how you have to go 1 -> erased -> 0 on a SSD? Well the erased -> 0 step is really fast. The 1 -> erased step is really slow. If you waited until the computer tried to write data to it to erase it, the write would go at like 200 kB/s. So the SSD keeps track of all these deleted 4k chunks, and in its spare time when you're not using the SSD it will go through the slow process of erasing them. In the old days (5 years ago), SSDs didn't know how filesystems worked, so the computer had to explicitly tell the SSD which 4k chunks were safe to erase. That's what TRIM was. Modern SSDs are programmed to understand common filesystems. So they're much better at erasing files which are actually deleted (not just the first 4k chunk) withing the computer telling it via TRIM. When the SSD erases the memory cells, the data originally on it is truly and completely gone.
So to answer your question, when you delete something from your SSD, it's initially just like a HDD - you don't actually delete it. But on a HDD as long as you don't write new data to the drive, the deleted file can still be recovered. On a SSD, if it does wear leveling or erasing of unused memory cells in the background, that can wipe out deleted data even though you haven't written new data to the drive.