A machine's generation sets its share of the fees once it is lit. Every buy draws a random id from the free ones, so the odds move with every trade.
A reroll is selling 1 MACHINE (your last dark machine dissolves) and buying 1 back for a fresh random id. You lose only the fees on both sides. Lighting costs the 1 MACHINE it burns.