How does NASCAR determine how much to pay each position?
The "base" payout for the race is in two parts. The racing purse is put up by the track and pays out on a straight declining scale, the winner gets more than second and so on down the line. On top of that is the television money which is also paid out on a declining scale.
Where it gets interesting is in NASCAR's "bonus" pay.
There are a number of different bonus payouts that drivers can be eligible for. For example the driver that leads the most laps wins the Front Runner award and a $10,000 bonus regardless of where he finishes. Sometimes there are awards for drivers that lead specific laps, "hard charger" awards for gaining the most positions, headache awards for having bad luck, etc. These will all affect the final prize money.
Various NASCAR sponsors can also pay out bonus money to the highest finisher using a specific product, and putting the decal on their car. If the winner is using the wrong motor oil or chooses not to participate in the program then that money may go to someone farther down the finishing order.
In addition, NASCAR itself has the Winners Circle Program. This is a bonus award program that goes to the previous season's top ten winners, by number of races won plus the first two winners in the current season who aren't already in the program. This bonus helps ensure that the sport's big names go to every race.
NASCAR has an additional bonus paid out to any team currently in the top 30 in points which makes the race.
So depending on how you did last year, where you are in the points this year, which sponsor decals you have on your car and any number of other factors you could earn more or less than any other driver in the race. How you finished that day is only part of the total story.