There's no good short answer, but the best I can muster is that it's based on play-by-play performance and stats, such that a good defensive rating emerges when, if someone is on the floor, the opponents tend to do a little less well than they do otherwise. There are a lot of adjustments for the specific players they're opposing, the teammates who are on the floor, the game context, and the extent to which stats reflect value-added on the floor. But the important thing to say is that it is NOT just box-score-based, i.e. overvaluing steals and blocks and defensive rebounds as all that "defense" consists of. It's play-by-play based, so it's teasing out the signal from that in similar ways to how +/- type metrics do, and is relying on box-score stats as a crutch, but one among several.
@bowiac (who seems to have gone dark around here) has extensive methodology pages if you want more detail, and offers statistical evidence that his system predicts future fantasy-relevant stat accumulation better than other all-in-one metric systems. So for example some of the optimizations it does, make its predictions stabilize against small sample sizes faster than other metrics like EPM or PIPM. Very useful attributes and a lot of thought and research are built in. But it's not a holy grail of defensive value - indeed, I'd say defense is the area that our best stats are weakest in. For one thing, the eye test and DARKO consistently disagree very strongly on Jaylen Brown's defense - and he's got many thousands of possessions of data, so it's not a matter of sample size. Instead it's a limitation of what we're able to capture. A categorical improvement over today's state of the art would probably require taking the motion-tracking data that has been available since ~2013, and use it to assess how closely people can stay to their guy, how good they are at switching, how rarely they lose somebody, and for 1v1 situations, how well they hold up - does their opponent shoot above or below expectation for each shot they take against you. Things like that. Shit, we only started getting stats on ball deflections (only some of which become steals) in the last few years. And let me assure you as someone who's played with similar data in soccer, working with motion-tracking data is EXCEPTIONALLY hard data engineering work. But for what was publicly available 5-6 years ago when he built DARKO, and is of reasonable data size and complexity, this was as good as anyone could really do, so we all tend to go to it first when we want a check on our hot takes.