Because hearsay is an out-of-court statement, but there are exceptions, including a statement against the person's interest. FRE 804(b)(3).*
In other words, if you try to introduce an out-of-court statement that supports your case, it's hearsay; if the statement is against your interest, it's allowable.
Of course there are other exceptions and nuances, but this is the jist of it.