We are not talking about an equivalence relation on $A$. We are talking about an equivalence relation on $V$, the class of all sets. If $A$ and $B$ are any two sets, then we say that $A\sim B$ if there exists a bijection (a one-to-one correspondence) from $A$ to $B$. It’s easy to show that the relation $\sim$ is an equivalence relation on $V$. And then we define the cardinality of a set $A$ to be the class of all sets $X$ such that $A\sim X$
This is a good definition, because it is easy to show that the cardinality of $A$ equals the cardinality of $B$ if and only if $A\sim B$. This exactly corresponds to the intuitive idea of “the number of elements in a set”. If you have a bunch of coconuts and a bunch of bananas, then the number of coconuts is equal to the number of bananas if and only if you can pair off the coconuts and bananas in a one to one correspondence.
And now we can define $0$ to be the cardinality of the empty set, i.e. the class of all sets that can be put in bijection with the empty set, i.e. the set containing the empty set. And we can define $1$ to be the cardinality of the set containing the empty set, i.e. class of all sets that can be put in bijection with the set containing the empty set i.e. the class of all singleton sets. And so on.
Note that this way of defining cardinal numbers is kind of old-fashioned; it was used by people like Gottlob Frege in the 1800’s, but it’s not used as much anymore. What is used more nowadays is the von Neuman definition, where we define $0$ to be the empty set $1$ to be the set containing the empty set, etc. But in my opinion the Frege definition makes the notion of cardinality clearer than the von Neumann definition. More for details see Gottlob Frege’s book “Foundations of Arothmetic.”