It IS all supposed to just work. For example, a newer 3.0 Gb/s or 6.0 Gb/s SATA drive is SUPPOSED TO figure out that it is connected to an older slower SATA controller port and automatically set its communication speed to match the port's. VERY often it does just that.
The one relatively common combination that pops up is: a SATA II (3.0 Gb/s) drive connected to an original SATA (1.5 Gb/s) controller port. In SOME of these combinations the SATA II drive fails to slow down automatically and needs to be forced to do it. Some HDD makers allow this by placing a jumper on a particular pin pair on the back edge of the SATA drive. (In fact, at least one HDD maker used to ship their SATA II HDD's with this jumper already installed to be SURE it would work with all SATA ports; you were supposed to remove it if you KNEW your SATA controllers also were SATA II.) Some HDD makers, however, had other methods like using a free downloadable utility to write data to the HDD.
NOTE that this is virtually the ONLY jumper setting the normal SATA drive user ever needs to adjust. There are NO jumper settings on SATA units for Master or Slave. In fact, in the case of one manufacturer, if you install a jumper on the wrong pin pair it can set the unit to a special mode in which the HDD appears to be dead! (Removing the wrongly-installed jumper fixes it with no harm.) So setting SATA jumpers wrong can actually CAUSE problems, so be careful.