I'm not massively convinced of the science but the theory goes that you ingest carbs that you don't necessarily require late in the evening, they are converted into fat rather than burned off.
It's anecdotal, but if I eat late I tend not to have lost anything in the morning.
Good because it's complete crap.
As long as you don't exceed your calorie allowance you can eat what you like whenever you like and you won't put on fat (this is massively simplified due to the way the body deals with different foods and your hormonal response but the basics are solid).