Perl 6Raku, 5353 48 bytes
{my ($m,$d);$d;/[\[{$d++;$m=max$d++;$!=max $m$!,$d}|\]{$d--}|.]*/;$m;$!}
> {my ($m,$d);$d;/[\[{$d++;$m=max$d++;$!=max $m$!,$d}|\]{$d--}|.]*/;$m;$!}("[[[3]][2]]")
3
{ my ($m,$d); # start closure,outer declareIIFE variablesclosure;
my $d; # declare depth variable `$d`;
/ # start IIFE regex match;
[ # start regex(non-capturing) matchgroup;
[ # EITHER:
\[ # match `[` in input; if successful then:
{ # start inner (non-capturingwithin regex) groupIIFE closure;
\[ {$d++;$m=max $m $d++; # increment depth variable; and then:
$! = max $!, $d} | # match(ab)use [`$!` andvariable to track MAX depth;
} # end inner IIFE closure;
| # OR:
\] # match `[` in input; if successful then:
{$d--} # decrement depth variable in IIFE closure;
| # match ] and track depth; OR
. # OR:
. # match one charactercharacter;
]* ]* # end capture group; match zero #or repeatmore grouptimes;
/; # end regex;
$! # end regex
$m # max depth as last value in closure;
} # returnend outer closure, returning last value (max depth);
}
("[[[3]][2]]") # pass string "[[[3]][2]]" as outer closure argument.