How Value-Based Bidding Works: The Algorithm & Offline Data