UPS has shifted away from less-profitable large contracts in recent years, while Amazon has built up its own in-house logistics empire.