We see evolution as based on the trial-and-error process of variation and natural selection of systems at all levels of complexity. The name of 'natural selection' comes from the Darwinian theory of biological evolution, which distinguishes "natural" selection from "artificial" selection, where specific features are retained or eliminated depending on a goal or intention (e.g. the objective of a cattle breeder who would like to have cows that produce more milk). The "implicit goal" of natural selection is maintenance or reproduction of a configuration at some level of abstraction. The selection is natural in the sense that there is no actor or purposive system making the selection. The selection we are discussing is purely automatic or spontaneous, without plan or design involved.
Evolution typically leads to greater complexity, although one must be careful how one defines complexity.