Let's see how many jars are implied. 5/7 of a jar leaves 2/7 left in the jar. 3/9 or 1/3 taken out of a jar leaves 2/3. Could it be the same jar? In other words, is there enough left in one jar to do this? To answer this question in simple terms, let's divide the jar into 21 portions. 2/7 of 21 is 6 portions and 1/3 of 21 is 7 portions. So it cannot be the same jar because we can't take 7 portions out of it if only 6 portions are available. That means there must be two jars. There will be 6 portions left in one jar and 14 in the other. If he needs to provide his 3 buddies with the same proportion as himself, his buddies will also need 5/7 of 21 portions=15 portions each, so he will need 3*15= 45 portions from one jar, which only has 6 portions left. What about the other jar? After taking 7 portions from the other jar, he's left with 14. His three buddies need 7 portions each, making 21 portions. But there are only 14 left in this jar. He will need more jars!
All we've done is use 21 portions instead of fractions of a jar. 1 portion is 1/21 of a jar and 21 is the lowest common denominator of 3 and 7. We could have picked the lowest common denominator of 7 and 9, which is 63, and worked out how many portions. But the conclusions would be the same. 5/7 of 63=45 and 2/7=18. 3/9 or 1/3 of 63=21, and 21 is bigger than 18, so we don't have enough portions left to take out 21. This is another way of saying 1/3 is bigger than 2/7.
The only way to split what's left in the jars is to divide the remains equally between the buddies, but that means they all get equal shares between themselves, but no-one gets as much as David. They would get 1/3 of 2/7 from one jar and 1/3 of 2/3 from the other jar: 2/21 and 2/9 respectively, and if the jars had been split into 63 portions, that would be 6 portions and 14 portions each. David's portions would be 45 and 21, a lot more! 45+3*6=63=21+3*14. See how the arithmetic works?