The expression in the subject title of your question illustrates the first few terms of the binomial expansion (which has lots of uses in mathematics) - see https://en.wikipedia.org/wiki/Binomial_theorem for more information.
In the body of your question the solver has assumed you want to equate the left-hand side with the right-hand side and has assumed nx is a variable in its own right (it doesn't recognise implicit multiplication). Strangely, it has also assumed (1+x)n is also a single variable (!) and has solved the equation as if it were a quadratic.
.