Mostly in the cinematic directing style, the dense plot, the non-romance nature of the show, and the emphasis on detailed directing and acting.
Both are shows in the daily-life-comedy genre with a heartfelt undertone. They both take pains to slowly and sympathetically explore the tough and happy parts of the ordinary lives of each character, and can be interpreted as commentary on modern society.
Looking for funny detective dramas that expertly balance humor with thrilling action and characters? Look no further: these two are the top of the line in detective comedy with an emotional side. In both shows, the comedy feels genuine (partly b/c of the strength of the main actors) and adds to the impact of the main, more serious scenes instead of feeling out of place or disconnected. Plot-wise, they aren't that similar, but in terms of crime shows that will make you laugh your ass off one minute, and have your eyes fixed on the screen in anticipation in the next, they're two peas in a pod.
These two have a lot in common: prosecutor/detective dramas w/ similar pacing, depth of plot, mystery, etc. One of the notable differences is that Stranger is about finding and catching the killer, while Defendant makes fairly clear who the villain is from early on (and thus can take time to develop a compelling villain character), but they have the same air of ruthless mystery and compelling characters that will make you want to binge the whole series in 2 days.