I believe you are referencing Matthew 12:1-2 which says, “At that time Jesus went on the sabbath day through the corn; and his disciples were an hungred, and began to pluck the ears of corn, and to eat. But when the Pharisees saw it, they said unto him, Behold, thy disciples do that which is not lawful to do upon the sabbath day.” 

Notice that the Pharisees did not accuse these men of stealing but accused the Lord’s disciples of working on the Sabbath day.  This act of picking corn was not forbidden under the Law, but was, in fact, expressly permitted.  We read in Deuteronomy 23:25, “When thou comest into the standing corn of thy neighbour, then thou mayest pluck the ears with thine hand; but thou shalt not move a sickle unto thy neighbour’s standing corn.”  The Lord was gracious to allow the poor to pick corn (or wheat) to satisfy their hunger, but they were not allowed to use a sickle to gather a great amount of corn, but enough to eat to fill their hungry bellies.  The Lord even instructed the farmers to leave a little of their harvest so that the poor might have some to pick and eat.  “And when ye reap the harvest of your land, thou shalt not wholly reap the corners of thy field, neither shalt thou gather the gleanings of thy harvest. And thou shalt not glean thy vineyard, neither shalt thou gather every grape of thy vineyard; thou shalt leave them for the poor and stranger: I am the LORD your God.” (Leviticus 19:9-10). 

On any other day of the week, we might suppose the Pharisees would not have accused the Lord’s disciples of disobeying the Law, but because this was done on the Sabbath, they sought to judge them guilty of transgressing the Law.  We read about this Sabbath restriction in Exodus 20:10, “But the seventh day is the sabbath of the LORD thy God: in it THOU SHALT NOT DO ANY WORK, thou, nor thy son, nor thy daughter, thy manservant, nor thy maidservant, nor thy cattle, nor thy stranger that is within thy gates.”  The Pharisees, desiring to find fault with Christ, said that, in plucking the grain on the Sabbath day, they had violated the commandment.  This sounds plausible, doesn’t it?  Certainly, the Lord’s men had intentionally worked on the Sabbath by plucking the ears of corn from the stalks, but had the disciples truly transgressed the Law?

Let’s look at the Lord’s response to this accusation in Matthew 12:3-6, “But he said unto them, Have ye not read what David did, when he was an hungred, and they that were with him; How he entered into the house of God, and did eat the shewbread, which was not lawful for him to eat, neither for them which were with him, but only for the priests? Or have ye not read in the law, how that on the sabbath days the priests in the temple profane the sabbath, and are blameless? But I say unto you, That in this place is one greater than the temple.” 

In response to their accusation, the Lord reminds them of how David, while in exile, took his men and entered the tabernacle, which was prohibited, and they ate the showbread, which was also prohibited under the Law.  I encourage you to read of this event in 1 Samuel 21:1-6.  How are we to understand this?  Does this mean that we can pick and choose what we want to obey and what we want to ignore of God’s Word?  Absolutely not!  It was because he and his men were under great distress that this action of David was not condemned.  It was a sinful nation that had rejected David and caused him to be in exile.  Through no fault of his own, David was hungry, and this act was obviously permitted by the Lord.  We must notice that David did not ‘take’ this showbread, but we see in 1 Samuel 21:6 that, “the priest gave him hallowed bread.”  It was no coincidence that the Lord used this incident to correct these Pharisees.  David, the rightful king of Israel was in a state of rejection by Israel.  The Lord, the rightful King and Lord of all, was also in a state of rejection by Israel.

Then, as concerning the ‘servile work’ of the disciples, the Lord reminded these Pharisees that the priests performed ‘servile work’ on the Sabbath and were not condemned.  Under a ‘misapplication’ of the Law, one might consider the priests as working on the Sabbath, even as it was a ‘misapplication’ of the Law that caused them to criticize the disciples for working on the Sabbath.  The Lord then goes on to proclaim that He is greater than the temple, that the Lord delights in mercy rather than sacrifice, He declares the disciples ‘guiltless’ and that the Lord Jesus, is Himself, the Lord of the Sabbath.   Without ever breaking the law, the Lord always acted in authority and proper application of the Law.  (CC)  (582.4)