Apparently, Ghenghis Khan was responsible for 40 million deaths. Joseph Stalin's regime is said to be responsible for 20 million. How do historians reach these estimations when the figures are so high? I understand that Nazi Germany was somewhat obsessive about record-keeping and that made estimating the number of deaths in the Holocaust relatively straightforward, but surely the same cannot be said for Ghenghis Khan? So on what do historians base their estimates?
As a secondary question, what does it mean to say that Ghenghis Khan or Joseph Stalin were 'responsible' for somebody's death? Would, for example, a convicted murderer being executed be included in the figures, given that this person would be executed in almost any contemporary society?
Regarding Chinggis Khan: the 40 million factoid is just that - something that is presented as a fact but is incredibly dubious. I wrote an answer to a similar question and it seems to have originally come from a 1959 demographic study of population trends Yuan Dynasty China that got misinterpreted into "deaths from Mongol conquests", which in turn got misinterpreted into "deaths caused by Chinggis Khan".
As for Stalin: the numbers are clearer than for the Mongols, but still very much estimates. We do have calculations for the numbers of people executed for political crimes (especially during the Purges of 1936-1938) - about 800,000 documented executions, as well as people who died in camps after being imprisoned for political crimes. But the line between "criminal" and "political" can get blurry - notably during collectivization a harsh law (the "Law of Spikelets") was passed that could result in lengthy prison sentences for people - often starving - picking up grain seeds from collective farm fields, on the pretense that it was "theft of state property". It's also worth noting that execution and camp records are often incomplete, or deliberately misleading, such as when terminally ill prisoners were released early so that their deaths wouldn't "count" on camp records. The generally-accepted death toll is around 1.5 million to 1.7 million, but there are credible estimates that go higher.
A big chunk of the deaths attributed to Stalin are deaths from famine, which are incredibly hard to calculate (in no small part because malnutrition more often than not weakens one's immune system and they die from other causes, such as disease). It's also controversial how deliberate the famines were, although the historic consensus is that they were caused by collectivization and other policies instituted by Soviet authorities. The death estimates here tend to be in the 5 to 7 million range. There are other estimates for deaths caused by population transfers, the 1946-7 famine which is partly blamed on Soviet policies, and various massacres like the Katyn Massacre. Timothy Snyder in a now-subscription required article makes the case that altogether this adds up to some 9 million deaths attributable to Stalin. The 20 million estimate does still come up...but it seems to be rarer and something nowadays of a maximum possible estimate rather than something born out by available records. Regardless we're still talking about millions of deaths.