This is a question about R programming, not about statistics. Thus, it would be more suited for our programming gurus on https://stackoverflow.com/. Nevertheless, here a quick answer:
Typing
plot(km, fun = function(x) 1-x)
gives you the desired result.
What you expect is what you would get if you were showing the total number of events in the cohort over time. Then, yes, the events in two treatment groups should add up to the total number of events.
That type of display isn't usually helpful, for a couple of reasons. First, it doesn't take censoring into account properly. Second, it makes it hard to compare against other data, as it depends on the overall sample size.
If there's only one event type that can happen at most once to an individual, what's of primary interest is typically the probability of survival over time. Probabilities are bounded by 0 and 1. That's what you get with a Kaplan-Meier plot. If 2 treatment groups differ in probability over time, then their individual survival curves will necessarily be on opposite sides of the combined survival curve. The group with higher-than-average survival at any time will be above the combined curve, the other one below.
With multiple events of the same type possible, which seems to be what you have in mind, the usual display is the estimated number of events per individual over time. See the plot at the end of Section 3.2 of the main R survival vignette. The same principle thus applies: with 2 treatment groups, the group with a higher number of estimated events per individual will be plotted higher than the overall estimate for the cohort, and the other group below.
Best Answer
The authors of this paper aren't very clear about how they generated Table II for this study on graft-versus-host disease (GVHD), a common complication following hematopoietic cell transplantation. According to Table I, there were 88 patients in the Haplo group (haploidentical donor for transplantation) and 444 in the MUD group (matched unrelated donor). Given the $n$ values, the % values are simply with respect to those totals in each group, and the p-values are corresponding Fisher exact test results.
The question is where the $n$ values came from. The methods seem to imply that Fine-Gray models were set up for each type of GVHD separately, with death as a competing risk in each case. That could produce the GVHD incidence percentages (and CI), which would then be multiplied by the numbers in the corresponding groups and rounded to the nearest integer to get the $n$ values. It's not clear that a Fisher test on the resulting integer point estimates of $n$ values would then be appropriate; tests comparing the Haplo and MUD groups more directly based on the Fine-Gray estimates would seem to be preferable.
That could be a less-than-ideal approach if there can be transitions among the different types of GVHD (e.g., an acute-to-chronic transition). A true multi-state model representing all possible transitions among outcomes would seem to be preferable. In the next-to-last row, where analysis was restricted to those with chronic GVHD to evaluate sclerosis, the result with a separate Fine-Gray model might even be misleading: it's not clear how the competing risk of death was evaluated in terms of getting into the chronic GVHD group in the first place.
The multi-state vignette of the R survival package explains several ways to approach competing-risk analysis. The Fine-Gray competing risks approach, which "turn[s] the multi-state problem into a collection of two-state ones," is explained in detail in Section 4 of the vignette with illustration of how to format and analyze data for Fine-Gray. Be sure to read that Section carefully before you jump into the Fine-Gray analysis, however, as there are alternate approaches that might be superior.
If you are going to analyze your own data on this subject, I'd recommend working with a statistician with experience in multi-state survival modeling to see if a better type of analysis than that shown in this paper is possible.