Confused about Fitbit calories

Just wondering if anyone can explain how Fitbits calculate how many calories you've burnt in a day. I've got a Fitbit One and it's giving some interesting numbers.

Yesterday I walked about 4,000 steps, and it says I burnt 1,580 calories. The day before I forgot to put it on, so 0 steps, 0 active minutes, 0 everything, and it says I burnt 1,857 calories. The day before that, nearly 6,000 steps, and 1,634 calories. The day before, 1,019 steps, and burnt 1,857 calories... again.

Why does it seem to think I burn more calories when I've done fewer steps in the day?

Replies