How is a hard drive connected to a portable computer?

It just slides in to a slot on most, but overall dependent on the model.