A bakery makes cakes and pies. A cake needs 2 hours of oven time and a pie 1 hour, and the oven is free for 10 hours a day; there is fruit for at most 6 pies. Profit is $5 per cake and $4 per pie. With x cakes and y pies, the limits are 2x+y≤10, y≤6, x≥0 and y≥0, and the goal is to maximize P=5x+4y.
Each limit cuts the plane along a line and keeps one side. Together they leave a polygon, the feasible region, with corners (0,0), (5,0), (2,6) and (0,6); the corner (2,6) is where 2x+y=10 meets y=6. Every point of the region is an allowed plan, and there are infinitely many of them.
Now picture the profit lines 5x+4y=P for larger and larger P. They are all parallel, so as one slides across the region, the last point it touches is a corner, or occasionally a whole edge. Test the corners: P=0 at (0,0), 25 at (5,0), 10+24=34 at (2,6), and 24 at (0,6). The best plan is 2 cakes and 6 pies, for $34.
Solving a system of equations finds where lines cross, with no goal; here (2,6) matters only because it is the corner that wins. Graphing inequalities shades the region and stops. Linear programming adds the objective and the corner test, and it needs everything to be linear: a profit like 5x2 could peak in the middle of the region.
Think of it like this. Finding the optimum is like pushing a ruler across a polygon cut from paper, keeping it parallel to the profit line. The last bit of paper the ruler touches before it leaves is a corner, because the ruler and the polygon's edges are all straight. If the profit rule were curved, the last point touched could be in the middle of a side.
Core idea. Linear programming maximizes or minimizes a linear objective over a region cut out by linear constraints, and the optimum always sits at a corner of that region.