The overall rate is an average of each spot's rate, weighted by its share of the shots
Of your 100 shots, only 10 are from the free-throw line, so your overall rate is 10% × 90% + 90% × 40%, which is 45%. Your friend took 80 from the free-throw line: 80% × 85% + 20% × 30%, which is 74%. The spot with the bigger share all but decides each person's total.
The fewer shots your friend takes close in, the smaller his lead
Have your friend move his free-throw shots, a few at a time, out beyond the three-point line. You stay at 45%. When he is down to 28, his overall rate is 45.4%, still ahead of you; at 27 it is 44.85%, and you are back in front. If each of you took half from the free-throw line and half from beyond the three-point line, you would have 65% and your friend 57.5%. Once the shares are evened out, the totals rank the two of you the same way every spot does.
If the grouping was settled beforehand, look at the groups; if the thing being compared caused it, look at the total
When the total and the groups point in opposite directions, first ask what the groups were split by and when that was settled. Where to shoot from was chosen by each person before the shooting started; the size of a kidney stone was set before the surgery. These were settled before the comparison, and they also affect success or failure, so look at the groups: shooting from the same spot beyond the three-point line, you are more accurate.
If the thing the groups are split by was caused by the method being compared, look at the total. Suppose a new teaching method gets more students to keep handing in their homework, and handing in homework raises grades. If you then split students by whether they handed in homework, the part of the improvement the new method brought about by getting people to hand in homework gets split away.
Simpson's paradox turns up most easily when the two sides have very different shares of people in each group and you compare rates or averages. It can't flip when you compare quantities that can simply be added, such as total items or total money: if one side has more in every group, it must have more in total. If you try every possible way of splitting the data and keep the one that flips the conclusion, all you have is a story you picked out.