In Naive Set Theory, in Section 1.3 "Unordered Pairs", Paul Halmos mentions the following:
If, temporarily, we refer to the sentence $”x=a \text{ or } x=b”$ as $S(x)$, we may express the axiom of pairing by saying that there exists a set $B$ such that $$x\in B\text{ if and only if } S(x).\tag{*}$$ The axiom of specification applied to a set $A$ [such that $a\in A\text{ and } b\in A$, whose existence is guaranteed by axiom of pairing], asserts the existence of a set $B$ such that $$x\in B\text{ if and only if } (x\in A\text{ and } S(x)).\tag{**}$$ The relation between $(*)$ and $(**)$ typifies something that occurs quite frequently. All the remaining principles of set construction are pseudo-special cases of the axiom of specification in the sense in which $(*)$ is a pseudo-special case of $(**)$.
Question: What does Halmos mean by stating that remaining principles of set construction and $(*)$ are pseudo-special cases of axiom of specification and $(**)$, respectively?
In fact, $(**)$ seems a special case of $(*)$.
I think the general principle here is that if you want to show that there exists a set containing precisely those elements $x$ satisfying some first-order formula $S(x)$, it is sufficient to show there exists a set containing at least those elements, and then invoke the axiom of specification. This is what's done when we use (**) to establish (*) - the original axiom of pairing, as stated by Halmos, asserts there exists a set containing $a$ and $b$, but allows for the possibility that all such sets contain additional unwanted elements. You need specification to rule out the latter.
So whenever one writes something like "let $A$ be the set of all $x$ such that $S(x)$", there may be a hidden use of the axiom of specification.