Defensive Rating specifically measures how the defense of a team performs. This can be at the team level - the Duke Blue Devils had a 97.1 Defensive Rating in the 2018/2019 NCAA season - or for each lineup, player, or situation within a team. This is accomplished by choosing some criteria (i.e. when James Harden is on the floor in the 4th Quarter) and dividing the points scored by the opponent by the opponent's total possessions. This provides a repeatable method for comparing and understanding how an offense performed or, if the sample is large enough, will perform in certain situations.
DefRtg = 100* [ (Opp Points) / (Opp POSS) ]
However, Defensive Rating is the surface level of defensive performance. How the opponent actually scored those points can vary significantly and can tell you more about the other team.
Shot types, avoiding fouls, forcing turnovers, and grabbing defensive rebounds all play significant factors in how a team allows points. As you may have noticed, those are the ever popular Four Factors and every defensive rating has a unique and easily understood signature.
For example, at this moment, Cassius Winston(Michigan State) and Tre Jones(Duke) have very similar defensive ratings, both around 96.6, but when we look at the four factors we see how different the paths can be to get there.