Instead of thinking of a commutative function as a function that takes an ordered pair of inputs, we can think of as a function that takes an unordered bag of inputs, and therefore can't depend on their order. On this interpretation, the fact that functions are always given inputs in a particular order is an artifact of our definitions, not a fundamental property of functions themselves. If we had notation for functions applied to arguments in no particular order, then commutative functions would be the norm, and non-commutative functions would require additional structure imposed on their inputs.
In a world of linear left-to-right notation, where means " applied to first and second", commutativity looks like a constraint. In an alternative world where functions are applied to their inputs in parallel, with none of them distinguished as "first" by default, commutativity is the natural state of affairs.
Commutativity can be seen as a form of symmetry in the output of a binary function. Imagine a binary function as a physical mechanism of wheels and gears, that takes two inputs in along conveyer belts (one on the left, one on the right), manipulates those inputs (using mechanical sensors and manipulators and tools), and produces a result that is placed on an outgoing conveyer belt.
There are two obvious ways we can imagine the function being symmetric in its use of the inputs. First is that all the mechanisms that the function uses to combine the two inputs could be left-right symmetric. We can see this symmetry in a function that takes two wooden blocks as input and glues them together: An arm on the left picks up the left block while an arm on the right picks up the right block; a third arm puts glue on the inward-facing sides of each blocks, the arms move together in synchrony to press the blocks together, producing an output where each input was manipulated in a symmetric fashion. We can also see this symmetry in a function that takes two strings and combines them with a dot between them (e.g., ), but not in the function which puts a dot in front of its two arguments ().This type of symmetry is not commutativity, it is associativity.
The other obvious symmetry is that the output can be symmetric in the way it contains the inputs. The reason that the function above was not commutative is because if it gets the input "red" on the left and "blue" on the right, then it produces the output "redblue", which has all the red on one side and all the blue on the other. Though the inputs were used symmetrically, the result is asymmetric.
By contrast, a function that mixes the red and blue together — producing, for example, the uniform color purple or the unordered set — would be commutative, because the way that the output relates to each input is independent of which side the input came in on.
A function is probably commutative if you can visualize the output itself as left/right symmetric, even if the left input was very different from the right input. For example, we can use the following visualization to show that multiplication is commutative. Imagine a function that takes in two stacks of poker chips, one on the left conveyer belt and one on the right conveyer belt. The function has a square of wet plaster in the middle. On each conveyer belt, an arm removes chips from the stack of poker chips until the stack only has one chip left, and for each chip that is removed, a perpendicular cut is put in the plaster (as in the diagram below). The plaster is then allowed to set, and the plaster pieces are then shaken out into a big bag. A third arm removes plaster pieces from the bag one at a time, and adds a poker chip to the outgoing conveyer belt for each one. To visualize this, see the diagram below:
If the input conveyer belts had 4 and 6 poker chips on them (respectively), then the output belt will have 24 chips on it (because 24 different chunks of plaster will have fallen into the bag), but the chips don't necessarily come from any one particular side: The output relates to each input in a manner that doesn't depend on which side they came in.
In mathematics, a symmetry is some properties on a set that are preserved under a transformation of that set. In our case, the preserved structure is the value of the function's output, and the transformation is changing which side the inputs come in on. If the value of a function's output is preserved under permutations of the inputs, then the output is symmetric in the way it relates to the inputs. Formally, a function has this type of symmetry if its value on a pair is preserved under the transformation which maps to ; i.e., if . This is the formal definition of commutativity.