Deuteronomy 23:24

When thou comest into thy neighbour’s vineyard, then thou mayest eat grapes thy fill at thine own pleasure; but thou shalt not put any in thy vessel.

Anyone coming into a neighbor's vineyard, field, or orchard, whether a traveler passing through or a hungry poor person, may eat grapes, grain, or fruit enough to satisfy hunger at the time, but must not put any in a vessel to carry away. The line is drawn so that immediate need can be met on the spot while the owner's harvest is protected from being taken away.

That permission is why the disciples passing through a field of standing grain could pluck heads and eat to satisfy their hunger, an act lawful on an ordinary day. The dispute over their doing so on the Sabbath turned not on stealing but on the ruling that gathering the grain was reaping and rubbing it out in the hands was threshing.