This saying is unique to Matthew. He has Jesus cite an example in Numbers, chapter 28:9-10, where there was a special sacrifice only on the Sabbath. This sacrifice had two male one-year old lambs without blemish, and two-tenths of an ephah of choice flour for a grain offering, mixed with oil, and its drink offering. This was the burnt offering every Sabbath. This was in addition to the regular burnt offerings and the drink offerings. However, this sacrifice was not mentioned in any other place in the Torah. Jesus asked them if they had read the law (ἢ οὐκ ἀνέγνωτε ἐν τῷ νόμῳ) where on the Sabbath (ὅτι τοῖς σάββασιν), the priests in the temple (οἱ ἱερεῖς ἐν τῷ ἱερῷ) broke or profaned the Sabbath with these sacrifices (τὸ σάββατον βεβηλοῦσιν), yet they were guiltless (καὶ ἀναίτιοί εἰσιν).
Joel continued with the same theme. They should return to Yahweh. Joel used the ancient words about God as gracious and merciful, since Yahweh was slow to get angry. He was abounding in steadfast love. He did not punish easily. Will he return? Will he relent? Your best shot was to leave a blessing, like a grain or drink offering for Yahweh, their God. Clearly, Joel was tied to the Temple, since he considered the grain and drink offering as a blessing.