It's the latter. You will always get a new phone if it's within the initial 14 days from purchase. Otherwise, it's up to the Apple Store.
Bear in mind an Apple refurbished phone is far different from other people online who claim to be selling a "refurbished" device. To them, that just means they've tried to clean it up and make certain it works. Apple does whatever is necessary to make a refurbished phone work and look as new. They always get a new battery installed. The screen is almost always replaced. It will also get a new case if the previous is scratched or dinged in any way.
An Apple refurbished device is always as close to new as it can get.