Ever notice how some things just make sense? A juicy apple doesn't come from a thorny bush. Jesus uses this obvious truth to call out hypocrisy.
Jesus is laying down a principle that's as clear as day: the nature of the tree determines the nature of its fruit. You can't logically have a good tree producing rotten apples, or a rotten tree bearing perfect peaches.
He's challenging the religious leaders directly. They're accusing Him of casting out demons by the power of Satan. But Jesus points out the inconsistency: if His 'works' (the fruit) are good – healing the sick, casting out evil – then the source (the 'tree') can't be the devil, who is inherently evil.
It’s a call for logical honesty: either acknowledge the works are good and therefore the source is good, or acknowledge the source is evil and therefore the works must be evil. They couldn't do the latter without condemning themselves, so Jesus forces their hand.