A binary operation on a set SS is a function

:S×SS\ast: S \times S \to S.

The critical point is closure: whenever aa and bb lie in SS, the product aba \ast b must also lie in SS.

Binary operations may or may not be associative, commutative, or possess identities and inverses. Those are extra properties, not part of the bare definition.

One-line intuition

A binary operation is a rule that combines two elements of the set and stays inside the set.