Compact objects in general relativity: From Buchdahl stars to quasiblack holes