Q:

How to naturally encounter the properties of identity, commutativity, associativity, and distributivity (to define abstract algebra)?

In elementary school, I remember learning about the basic algebraic properties of the integers like identities, commutativity, associativity, and distributivity, and not really thinking much about them (I mean, as a kid I thought they were obvious and not worth dedicating a month to, haha). Now that I'm starting abstract algebra, these four things pop up again, but this time around, these laws seem far more mysterious, perhaps because they are being used as some sort of "basis" for generating a "valid" algebraic structure, instead of just random facts about numbers.
My question is this; I would expect there to be lots of formulas regarding elementary arithmetic, but somehow these four ideas generate everything. How could one trying to isolate algebraic properties of $\mathbb Z$ come up with this exact "basis"? Is there some kind of logical/algorithmic method we could use to systematically discover these laws and be sure that they encompass everything we care about when it comes to elementary arithmetic?
For example here: What is the role of associative and commutative properties in Mathematics and what if someone want to prove them??, one answer proved commutativity of addition from the Peano axioms. But surely there could be tons of little identities proven from the Peano axioms, about the same level of difficulty, so why should commutativity be so important compared to all the other "exercise problems"?
Phrased another way; is there another list of properties that in a sense is equivalent to the four I mentioned above? If so, what reasons would one consider when choosing which "basis" do define abstract algebra with?
The problem is that these laws don't seem obviously important a priori, so I am hoping that someone has some sort of motivating example to illustrate how these properties sort of "bubbled up" out of the stew containing all arbitrary identities. For example, one answer here: Jacobi identity - intuitive explanation, claims that the Jacobi identity arose out of examining the properties of an important commutator (though I do not at all know what that all means; it is just an example to illustrate what I would want a "motivating example" to look like).

An idea I had was that if someone could tell a story about building arithmetic from the Peano axioms, like here: https://www.math.wustl.edu/~kumar/courses/310-2011/Peano.pdf, sort of like: ok we defined the operator $+$ that takes in two things from $\mathbb N$ and spits out one thing in $\mathbb N$ recursively by saying $n+1 = \sigma(n)$ and $n+\sigma(m)=\sigma(n+m)$. Now an example: we already defined "$1$", and let's define $2$ as $2 = \sigma(1)$. Then $1+1=\sigma(1)=2$. Nice! How about $2+1$? Well, $2+1 = \sigma(2)$ which we'll call $3$. But what if I asked about $1+2$? Then the 1st rule won't help, but we can write $1+2=1+\sigma(1)=\sigma(1+1)=\sigma(2)=3$. Yay! But this was annoying because we know intuitively that switching the things around on the $+$ operator doesn't change anything, so let's prove this property (which we'll call commutativity).
However, I can't seem to shoehorn associativity or distributivity in a convincing manner, so perhaps this is the wrong approach.
Another idea I had was like starting again from the Peano axioms and then saying like "ok, we rigorously defined numbers and addition and multiplication and induction. Let's do the age old Gauss integer sum problem from the Peano axiom framework!". This problem immediately forces us to define addition for $n$ numbers (associativity), and then the end result involves $n(n+1)$ so distributivity comes up naturally. However, this is kind of awkward (like it's awkward to shoehorn in Gauss's sum problem randomly in the middle discussing foundational arithmetic--at least it feels slightly unnatural in my eyes), so I don't know. Phrased another way, my complaints for this idea is that there arise two questions: "why should we consider this Gauss problem" and "why should this problem be all that is needed to develop every property we care about in arithmetic"?
Criticisms and ideas are welcome!

A:

I think associativity and commutativity come very natural.
Suppose we want to give an abstract definition of what adding numbers is independent of the order means. What are the first things that come to mind? It doesn’t matter if we add $x$ and $y$ or $y$ and $x$, ie. commutativity. And (under the assumption that we aren’t capable of multitasking and can only add two numbers at a time) it doesn’t matter which two numbers of $x,y,z$ we add first. Now since we have commutativity, we have transpositions and thus arbitrary permutations, so we can reduce the second axiom to fix an order $(x,y,z)$ and express it as associativity.
Now the question becomes if the axioms suffice or if there is something left. Indeed fixing an order of the numbers of a summation, say small to large, by an inductive argument we see that by commutativity and associativity any summation equals the summation with fixed order. Thus we have found two axioms which precisely state that addition is independent of the order.
For distributivity I don’t have a good explanation though. It comes rather natural from a geometric standpoint, but it is not clear to me why commutativity, associativity and distributivity together encapsulate all one needs to do number theory.
A very abstract notion which kind of circumvents the generating axioms problem is given by Lawvere theories. Instead of considering axioms, which generate the theory of say groups, one considers the whole theory at once, ie. doesn’t prefer one relation over the other. Yet I believe that to do something with such theories, one has to pick a basis for the theory. The three axioms above happened to be ones, which came most naturally.

A:

This question is of course pretty vague and opinion-based. However, here's some "motivating example[s] to illustrate how these properties sort of "bubbled up" out of the stew containing all arbitrary identities".
First off, you should be aware that mathematics usually proceeds from the specific to the general, which is backwards from how it's often taught after the key insights and properties have been isolated. Mathematicians aren't always particularly good at calling out the motivating examples either. Without those motivating examples, it can be very hard to see why their abstractly isolated properties are so important.
Groups
Groups are modeled entirely on collections of automorphisms (more classically, "symmetries"). The dihedral groups, i.e. the symmetries of a regular $n$-gon under rigid motions, are perfect examples. Identity, associativity, and inverses are obvious for such "concrete" automorphism groups. Cayley's theorem says that all abstract groups can be realized concretely as a subgroup of permutations.
Fields
Fields are modeled entirely on two ancient examples--$\mathbb{Q}, \mathbb{R}$--and one very old example--$\mathbb{C}$. Identity, commutativity, associativity, distributivity, and inverses all hold for clear geometric reasons.
If you study linear systems of equations, you'll almost surely start with coefficients from one of these three structures. You'll eventually view them geometrically and generally invent linear algebra (subspaces, bases, kernels, ...). You could write out three different versions of linear algebra, one for $\mathbb{Q}$, one for $\mathbb{R}$, one for $\mathbb{C}$, but you'll immediately notice the proofs are literally identical and just use identity, associativity, distributivity, and division [commutativity is generally unnecessary, actually; see division rings]. Anyway, bam--you've just invented the general concept of modules over a field.
Beyond those three, the next most important examples are the finite fields $\mathbb{F}_p$ and number fields, $\mathbb{Q}(\alpha)$. Galois theory does an excellent job of motivating these, e.g. the proof that you can't trisect an arbitrary angle considers a number field as a module over a base number field. Trying to attack Diophantine equations "locally" motivates them as well. If you hadn't already phrased linear algebra for an arbitrary field, you'd almost surely do so at this point. (After those examples, function fields and residue fields are where it's at.)
Rings
Commutative rings are modeled entirely on function spaces. Take $X = \{f \colon \mathbb{R}^2 \to \mathbb{R}\}$. You can add and multiply these functions (point-wise) and they inherit identity, commutativity, associativity, and distributivity from $\mathbb{R}$.
One quickly restricts the type of functions allowed, typically measurable, smooth, continuous, rational [so partially defined], or algebraic. Each restriction technically results in a new algebraic structure, and often you want to replace $\mathbb{R}^2$ with other spaces, but the most basic properties remain the same. For instance, using polynomial functions from $\mathbb{R}^n \to \mathbb{R}$ results in the $n$-variable polynomial ring $X = \mathbb{R}[x_1, \ldots, x_n]$. We don't want to require division to always be valid, since functions can be zero at some points. So we just don't require it.
From a purely algebraic standpoint, by far the most important example of a commutative ring is a finitely presented algebra over a field, $k[x_1, \ldots, x_n]/(p_1, \ldots, p_m)$. These show up all the time "in nature": they precisely model the functions on a space where two functions are considered equivalent if they have the same values on a fixed subset. For instance, if you're doing polynomial interpolation, you'll immediately ask how unique your solution is. Hilbert's basis theorem says these are all the examples under appropriate finiteness constraints.
On the non-commutative side, the most important example is probably rings of square matrices. These too are function spaces, namely linear functions $\mathbb{R}^n \to \mathbb{R}^n$, say, where the product is composition instead of point-wise multiplication.
Other important non-commutative examples include group rings (motivated beautifully by representation theory; these can also be thought of as scalar-valued functions on the group) and Weyl algebras (PDE's motivate these very well; they can be thought of as endomorphism rings). When studying these things, you'll inevitably invent modules over these rings, e.g. annihilators, ideals.
Lie Algebras
Since you mentioned it, I'll say that Lie algebras are entirely modeled after matrices under the commutator, and the Jacobi identity is the main general identity available. Alternatively, the Jacobi identity is exactly what you need to say the adjoint representation is a Lie algebra homomorphism, and the usual theory of the universal enveloping algebra says the Jacobi identity is the only general algebraic identity available in this setting. Ado's theorem says these are all the examples under appropriate finiteness constraints. This is then "globalized" to Lie groups.

