partition delete or partition format, it doesnt remove any data, it just clears drive header which stores where are files (data) located on drive, so any operating system will show drive as empty
old data on HDD will all be still there, but it will be slowly overwritten once you start writing some new data
if you plan to format old HDD and sell it like this, all data can be recovered
in case of SSD its a bit different, SSD requires to have empty cells to have best performance, so once you format/delete partition, TRIM will activate (its not instant process, but it happens in background without user notice - drive controller takes care of this) which rewrites any deleted data into empty space to keep SSD performance at its max
you can also secure erase/sanitize SSD on your own to wipe it to get max performance (all drive cells gets overwritten into zero about 3-5times, so dont do that repeatedly as it can shorthen drivespan if you wanan do that on weekly basis lol)