The *s after (\$) and (\=) mean, as always, zero-or-more.
The .*\n? means zero-or-more of any character(s) optionally (due to the ?, which means zero-or-one) followed by a \n.
That means that .*(\$)*(\=)*(\<).*\n? will match any line with (\<) regardless of whether it is preceded by an escaped $ and/or an = or not.
In English, the regexp reads as "zero-or-more characters, optionally followed by a $, then maybe an =, then a < (not optional), then zero-or-more characters, optionally followed by a newline."
In other words, the entire regexp, ignoring the captures, is equivalent to just <.  It's the only thing in the regexp which isn't optional.
BTW, use + instead of * if you mean one-or-more.
You might want to try something more like:
grep -P '\$var\s*=\s*['"].*<[^>]+>'
That matches $var followed by zero-or-more whitespace chars, then an =, then zero-or-more whitespace again, followed by an ' or an ", then zero-or-more of any character followed by a < then any character except a >, followed finally by a >.
e.g. $var='....<h1>' would match.
Note, this won't catch any $var='htmlcode' where there's a newline between the 'var=' and any html.
     
    
grepcommand you ran.