Because by not eating much to nothing, you detoxed yourself. Like others have said, certain foods trigger ADD like symptoms. If you ate Sugar 3 days ago, it's been burned up by now and you didn't add more..which would result in better concentration.
My guess is your diet isn't that great. It's probably high carb. But even if you ate just a little junk food, you used it up and burned it off pretty fast by not eating anything else.