The method is particularly suited for when the system and the goal can be described with an environment (e.g. a labyrinth), an observer (a sensor), an agent (a control system), and a reward system modelling an objective (get out of the labyrinth in shortest possible time). The controller will then, through randomized trial and error, explore the different options and get feedback in the form of rewards, and then alter its behavior to maximize the expected future reward.
Reinforcement learning
Reinforcement learning is what many people associate with "real" artificial intelligence: "a system that can learn to do complicated things by trial and error".