The most relevant definition that the previous commands display is
Self : DeleteDuplicatesBy[expr_, f_] :=
Module[{r$},
r$ = Which[!
Quiet[TrueQ[! AtomQ[expr] || AssociationQ[expr] ||
Head[expr] === SparseArray]],
Message[DeleteDuplicatesBy::normal, 1, "HoldForm"[Self]];
Macros`$FailRHS, True,
Macros`HoldSequence[
Which[ListQ[expr], Values[GroupBy[expr, f, First]],
AssociationQ[expr],
Association[Values[GroupBy[Normal[expr], f@*Last, First]]],
Head[expr] === SparseArray,
DeleteDuplicates[expr, f[#1] === f[#2] &], True,
expr[[Values[
GroupBy[Table[{f[expr[[i]]], i}, {i, Length[expr]}], First,
First]][[All, 2]]]]]]];
Macros`ReleaseHoldSequence[r$] /; !
MatchQ[r$,
Macros`$FailRHS | Macros`HoldSequence[Macros`$FailRHS]]]
If we predict where we will end up for a list, thisthe definition basically says