One of the Zermelo-Frankel axioms of set theory. Also know as the axiom of regularity, the axiom of foundation is not needed in general mathematics but affords a certain peace of mind to set theorists.

Axiom Whenever A is a nonempty set, there is a set y in A such that the intersection of y and A is empty.

Pick any set. If it's not empty, you can choose any of its members, and if that set isn't empty you can choose one of its members, and so on. From the axiom of foundation it can be shown that this process must eventually (ie. after finitely many steps) finish, when you have to pick the empty set.

Consequently, you can't have any set being a member of itself, or sets a and b such that a is in b and b is in a, or any nonsense like that.

Without the axiom of foundation, it's consistent that there is a set a such that a={a}. You can't actually construct such a set, but you can't prove it's not there either.