What does it mean for a set $S$ which contains $a$ and $b$ to have an operation $*$ that assigns an element $a*b$?
I think it means for example, if $S = \{a,b,c,\ldots\}$ and the set has the operation $*$ that you can use the operation with the objects in whatever way. So like we can say $a * b$ but we can also say $c * a$.
Like SummerAtlas and Sassatelli commented, a binary operation $*$ on a set $S$ is just a function from $S \times S \to S$
See how $+$ is defined on the set of natural numbers, $\mathbb{N}$
Moreover for any given set $S$ and an operation $*$ defined on $S$, $a*b$ and $b*a$ need not necessarily be equal for $a, b \in S$. For example take the subtraction operation on the set of Integers, $\mathbb{Z}$. See that $(1-2) \neq (2-1) $