Fasting has many merits, some physical, some psychological. None is religious. When Jesus references fasting, it’s to make a point about ostentation, not about hunger.
Fasting was a practice of religious ritual in the particular time and place within which Jesus conducted his ministry, as the temple in Jerusalem was the seat of ecclesial authority, and Saturday a religiously sanctioned day of inactivity. Had God incarnate entered humanity at a different time in a different place, the messages would have been the same: do not advertise your piety; true worship is vagabond; acts of charity are most highly esteemed by God. All that would have changed are the illustrations.