DR is relative: a value only means something next to other domains in the same index. Because the scale is logarithmic and Ahrefs' index changes daily, a DR of 40 is not a percentile — it does not mean "stronger than 40% of the web". The same backlink profile can also read differently in different indexes, which is why DR values from Ahrefs, Moz, and Semrush are not interchangeable.
The score is driven by the referring domains that point at a site: how many there are, how strong those domains are themselves, and whether the links are followed. The calculation is recursive — your DR depends on the DR of sites linking to you, which depends on theirs.