Hunger is a game mechanic that was added in Beta 1.8. Instead of directly restoring health, eating food will fill a player's food bar (sometimes referred to as the "hunger bar").
The hunger bar depletes slowly over time. When a player's food bar is or higher, the health bar will slowly refill. A player's food bar will not decrease in "peaceful" mode. In Creative Mode, players do not have a hunger bar, although they will be able to eat.
When a player is sprinting or Jumping, the Food Bar will deplete much faster, and a player will be unable to sprint once the hunger bar falls to or less. Players can get Food Poisoning from eating Raw Chicken, a Pufferfish, Rotten Flesh, or getting hit by a Husk. Food Poisoning changes the appearance of the hunger bar, giving it a green outline, and it causes the hunger bar to rapidly deplete.
When the hunger bar is empty, a player's health decreases by half a heart every few seconds.