I did a module or two on Artificial Intelligence during my Bachelor's degree. This is only one of many possible ways of aping intelligence in machines, in this particular case it's called a Genetic Algorithm, because it models the process of evolution and natural selection. Random "mutations" are introduced each generation (or more successful automata from the previous iteration are combined to mimic sexual reproduction in more sophisticated versions) and then they are tested, the best ones from that round are used as the basis of the next round.
There are many other approaches, you've probably hears of artificial neural networks, self-organising networks of devices that behave somewhat like tunable logic gates that can be either active (firing) or inactive (not firing) depended on the weighted sum of their inputs (one kind popularly used for teaching is called the Perceptron), which are programmed with a simple feedback mechanism that adjusts the input weights amongst every things, reinforcing weights that triggered a desirable response and weakening weights that didn't, in a process that attempts to model what we think happens in a natural brain during the learning process.
You might have heard the term "deep learning" being bandied around as the new hotness, all it really is is a new method of handling the training feedback in a neural network that allows it to be more than 3 layers deep (traditional neural networks were limited to 3 layers; an input layer, an output layer and a single "hidden" layer between them, because feedback could not be adequately propigated to multiple hidden layers. Deep learning overcomes this limitation, allowing you to have more than 1 hidden layer in a network).
There are also heuristics (simple rules that when aggregated together can give the illusion of intelligence in what is known in the trade as emergent behaviour), expert systems, baysean filtering and so on. The oldest trick in the intelligent machine playbook is simple brute force, which is how most chess programs work. They don't do anything intelligent, they are just able to play multiple scenarios (limited usually by memory and processing power needed to compute them all in a reasonable amount of time) and then apply simple heuristics to select the best scenario from the list of generated ones, on the assumption that the human player will probably select a move that's logical to make given the current state of the game.
While this video isn't inaccurate as such, it only covers a very tiny sliver of the whole sphere of machine learning, and takes a very simplistic view of it.
The video also vastly overeggs the idea that our lives are being controlled by sinister "intelligent" algorithms that even the makers don't fully understand. Most of them are in fact based on ideas that have been around for years and are still hand-crafted (Youtube probably doesn't use advanced AI for its video recommendations, it's more likely using a set of heuristics and possibly some trainable filtering).