This is a very quick and dirty, non-technical explanation. There are thousands of pages written on the technical explanation. If you wear a pocket protector for your shirt pocket, I am sure you will go there. On new hard drives there are ALWAYS bad sectors. Manufacturers put a large amount of extra sectors on a hard drive to make up for this and be fair. As a drive becomes older they lose magnetism and the number of bad sectors grow. Any information written on a bad sector can and will become corrupt. Bad RAM will also corrupt information and because of virtual memory be put it back on the hard drive making it look like a hard drive problem.
You want to back up your data. Then with disk utilities on your OS X install disk you want to format the hard drive, using the Write Zeros/Zero Out Data option. This option will perform a test on the hard drive as it writes zeros to the drive's platters. During the test, Disk Utility will map out any bad sections it finds on the drive's platters so they can't be used. This helps ensure that you won't be able to store any important data on a questionable section of the hard drive. This format process can take a fair amount of time, depending on the drive's capacity.