The immediate connection between this section and what precedes is twofold. The first is the theme of rising opposition ( Matthew 11:2 to Matthew 13:53), and the second is the heavy yoke of Pharisaic tradition that made the Israelites weary and heavy laden ( Matthew 11:28-30). The aim of the Sabbath was to provide rest, which Jesus said those who took His yoke upon themselves would find. It was not to provide a burden, which the Pharisees had made it by their traditions. [source][source][source]
Matthew recorded that Pharisaic opposition began when Jesus forgave sins ( Matthew 9:1-8). It increased when Jesus associated with tax collectors and sinners ( Matthew 9:9-13). Now it boiled over because Jesus did not observe the Pharisees" legalistic traditions. [1][source]
". . . the leaders (Pharisees), in charging the disciples with breaking the law by plucking grain on the sabbath and hence working, do what they heretofore have not done: they engage Jesus himself in direct debate ( Matthew 12:1-8)." [2][source]