6. There are $n(n \geqslant 2)$ cards, each with a real number written on it, and these $n$ numbers are all distinct. Now, these cards are arbitrarily divided into two piles (each pile has at least one card). It is always possible to take one card from the first pile and place it in the second pile, and then take one card from the second pile and place it in the first pile (it can be the same card), such that the sum of the numbers on the cards in each pile is equal to 0. Find the maximum possible value of $n$.
6. The maximum possible value of $n$ is 7.

If given seven cards, each written with $0, \pm 1, \pm 2, \pm 3$, it is easy to verify that they meet the requirements.
Below is the proof that the number of cards cannot be more.

Take any one card as the first pile, and the remaining cards as the second pile. After the operation, the first pile will have only one card. Therefore, this card must be written with 0.

For a card written with a non-zero real number $a$, place it and the card written with 0 in the first pile, and the remaining cards in the second pile. After the operation, the first pile will have exactly two cards. Therefore, it is only possible to replace the card written with 0 with a card written with $-a$.

Thus, the real numbers on all cards must be 0 and several pairs of opposite numbers.
Assume the positive real numbers written on the cards are
$$
a_{1}<a_{2}<\cdots<a_{n} \text {. }
$$

If $n \geqslant 4$, first divide the cards written with $a_{1}, a_{2}, \cdots, a_{n}$ into the first pile, and the remaining cards into the second pile. Note that, after the operation, the first pile can only exchange one card. Therefore, it is only possible to replace the card written with $a_{n}$ with a card written with $-a_{n}$ (any other exchange will result in a final sum greater than 0). Thus,
$$
a_{n}=a_{1}+a_{2}+\cdots+a_{n-1} \text {. }
$$

Next, divide the cards written with $a_{2}, a_{3}, \cdots, a_{n}$ into the first pile, and the remaining cards into the second pile. Note that, if the first pile does not replace the card written with $a_{n}$ with a card written with $-a_{n}$, the sum will definitely be greater than 0. If the first pile replaces the card written with $a_{n}$ with a card written with $-a_{n}$, the sum will definitely be less than 0. Neither satisfies the requirement.
Therefore, $n \leqslant 3$, meaning the total number of cards does not exceed 7.