Given $[0,1]$ a closed interval on $\mathbb{R}$, we know that $[0,1]$ is compact and $\mathbb{R}$ is not, so these two spaces are not homeomorphic to each other.
But homeomorphic perserves cardinality. Since there is no homeomorphism, does that mean the cardinality are diferent between the two sets?
The cardinalities of two sets $X$ and $Y$ are the same iff there exists a bijection between them.
The topological spaces $X$ and $Y$ are homeomorphic iff there exists a bijection between them that is continuous in both directions.
As you can see, homeomorphicity is a much stricter requirement, so it shouldn't come as a surprise that there are sets that have the same cardinality without being homeomorphic.