It’s highly likely that Carmax is using the opportunity as free advertisement. However per FTC and Youtube rules, sponsored videos have to be labeled as such. I don’t think that this youtuber would risk his reputation and his bank account for taking money under the table for Carmax and then getting slapped with a fine or worse.
I think Carmax figured it was mutually beneficial and allowed things to proceed. They ran the risk of looking bad if the guy did not have a positive experience, but i presume it worked out for both parties. Carmax gets exposure and the guy gets views.