Jesus, in the Gospel said, "The Sabbath was made for man, not man for the Sabbath."
By that he meant that our tending to basic human needs takes priority over our meeting our religious duties.
The disciples, needing to nourish their bodies, were excused from tending to the purely religious duty of not working on the Sabbath
The need of the disciples to take care of their basic human needs, puts me in mind of something that happened when I was a twenty-year-old seminarian. Together with three younger boys, I was acting as a counselor at a Summer camp down in the Ozarks. We used to take an early morning hike into a country town for daily Mass.
One Friday the priest there, Father Pulumbo, asked us to stay over for the weekend to help with his carnival. When I asked him where we could sleep, he told us we could use the parish convent. He said the nuns had left the parish
When i asked him about that, he said, "I got a phone call about a multiple accident down the highway. And when I was going out to my car, I saw the nuns going over to the church for their afternoon prayer time. I asked them to come with me, in case the people needed help, but they said it was the hour for them to pray, and their rule would not let them postpone it.
Father Polumbo then said that he told the nuns to say their prayers, and then move away until they could get their priorities straight.