in your example there seem to be two measured variables, T which can take two values {received treatment A, received treatment B} and another one, let's call it U, which can also take two values {recovered from disease, did not recover from disease}. Then there is also a hidden variable we can V, which can take two values {large kidney stones, small kidney stones}. In your example there is a marginal correlation between variables T and U, but there is still a correlation (albeit a different correlation) when we condition on either of the two specific values of V. So, let me modify your example with some different numbers. Suppose 40% of the population have large kidney stones and 60% have small ones. Suppose those with large kidney stones have an 0.8 chance of being assigned to group A, and an 0.2 chance of being assigned to group B. Suppose those with small kidney stones have an 0.3 chance of being assigned to group A, and an 0.7 chance of being assigned to B. Then suppose that the chances of recovery depend only one whether one had large or small kidney stones and is not affected either way by what treatment one received, so P(recovers|large kidney stones, treatment A) = P(recovers|large kidney stones), etc. Suppose the probability of recovery for those with large kidney stones is 0.5, and the probability of recovery for those with small ones is 0.9. Then it would be pretty easy to compute P(treatment A, recovers, large stones)=P(recovers|treatment A, large stones)*P(treatment A, large stones)=P(recovers|large stones)*P(treatment A, large stones)=P(recovers|large stones)*P(treatment A|large stones)*P(large stones) = 0.5*0.8*0.4=0.16. Similarly P(treatment A, doesn't recover, small stones) would be P(doesn't recover|small stones)*P(treatment A|small stones)*P(small stones)=0.1*0.3*0.6=0.018, and so forth.
In a population of 1000, we might then have the following numbers for each possible combination of values for T, U, V:
1. Number(treatment A, recovers, large stones): 160
2. Number(treatment A, recovers, small stones): 162
3. Number(treatment A, doesn't recover, large stones): 160
4. Number(treatment A, doesn't recover, small stones): 18
1. Number(treatment B, recovers, large stones): 40
2. Number(treatment B, recovers, small stones): 378
3. Number(treatment B, doesn't recover, large stones): 40
4. Number(treatment B, doesn't recover, small stones): 42
If we don't know whether each person has large or small kidney stones, this becomes:
1. Number(treatment A, recovers) = 160+162 = 322
2. Number(treatment A, doesn't recover) = 160+18 = 178
3. Number(treatment B, recovers) = 40+378 = 418
4. Number(treatment B, doesn't recover) = 40+42=82
So here, the data shows that of the 500 who received treatment A, 322 recovered while 178 did not, and of the 500 who received treatment B, 418 recovered and 82 did not. There is a marginal correlation between receiving treatment B and recovery: P(treatment B, recovers)=0.418, which is larger than P(treatment B)*P(recovers)=(0.5)*(0.74)=0.37. But if you look at the correlation between receiving treatment B and recovery conditioned on large kidney stones, there is no conditional correlation: P(treatment B, recovers|large stones) = P(treatment B|large stones)*P(recovers|large stones) [on the left side, there are 400 people with large stones and only 40 of these who also received treatment B and recovered, so P(treatment B, recovers|large stones) = 40/400 = 0.1; on the right side, there are 400 with large stones but only 80 of these received treatment B, so P(treatment B|large stones)=80/400=0.2, and there are 400 with large stones and 200 of those recovered, so P(recovered|large stones)=200/400=0.5, so the product of these two probabilities on the right side is also 0.1] The same would be true if you conditioned treatment B + recovery on small kidney stones, or if you conditioned any other combination of observable outcomes (like treatment A + no recovery) on either large or small kidney stones.