If a celebrity have an endorsement deal, how does it work?

Say the deal is for $500,000. Do they get the $500,000 upfront, and every time a commercial come on for the product they get additional money? Or, they just get the 500K and keep it pushing? I’m just being nosey. I cannot find anything on Google.
2 answers 2