Fliers are so focused on what the airlines don't provide these days that they sometimes (wrongly) assume that no meal will be provided for their flights.
The policy varies by airline, so there's no ironclad rule you can use to determine if a plate of food will be set on your tray table. But most long-haul flights (four hours or more) include at least one meal, and some trans-oceanic flights will include several feedings.
On short flights, you are unlikely to be served a meal. On budget airlines, you will pay for snacks and drinks as well as meals.
Don't buy plane food elsewhere if it's included in your airfare. Don't assume it's not included. When you book your flight, it's easy enough to make a quick check of the food offerings.