It's lack of parameter sniffing. The optimiser can't sniff the values of variables and hence assumes a default row count estimation.
Usually fixed by either OPTION(Recompile) or OPTION(Optimize for ...)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability