Those two issues are quite separate: (1) whether a function's graph intersects a horizontal line, and (2) whether the horizontal line is an asymptote to the function's graph.
Let us say that the function is $y=f(x)$ and the horizontal line is $y=b$. You find if they intersect by solving the equation $f(x)=b$. You find if the line is an asymptote by checking if either $\lim_{x \to -\infty}f(x)=b$ or $\lim_{x \to +\infty}f(x)=b$.
Some examples: The function $f(x)=\frac 1x$ has the horizontal asymptote $y=0$ but does not intersect it. It does intersect $y=1$, which is not an asymptote.
The function $f(x)=\frac{\sin x}x$ also has $y=0$ as a horizontal asymptote, but here the function does intersect the line (infinitely many times). It intersects $y=\frac 12$ a few times but does not intersect $y=2$ at all.