Apple sells refurbished units online in their refurbished store. They have information there on what their OEM refurbishment process entails. Refurbished devices bought from Apple have a standard one year warranty and are eligible for extended warranty.
A replacement unit is just that - a service unit used to replace a device. Every company sets aside some proportion of production as service units right from the factory, to provide stock for warranty replacements. Service units may be factory new, or they may have failed some factory inspection that required repair and so were pulled from the standard shipping line and end up (once fixed) in the service unit allotment.