Sometimes we encounter problems which are really hard to solve by writing a computer program. For example, let's say we wanted to program a computer to recognize handwritten digits:
You could imagine trying to devise a set of rules to distinguish each individual digit. Zeros, for instance, are basically one closed loop. But what if the person didn't perfectly close the loop. Or what if the right top of the loop closes below where the left top of the loop starts?
In this case, we have difficulty differentiating zeroes from sixes. We could establish some sort of cutoff, but how would you decide the cutoff in the first place? Similarly, we'd need to come up with a list of rules for each digit. As you can see, it quickly becomes quite complicated to compile a list of heuristics (i.e., rules and guesses) that accurately classifies handwritten digits.
There are many more problems that fall into this category. Recognizing objects, converting speech to text, checking if an email is spam, predicting the price of a house, etc. Often, we don't even know what program to write because we still don't know how it's done by our own brains. And even if we did have a good idea about how to do it, the program might be horrendously complicated.
Machine Learning offers a better solution. The ML approach to this problem is, collect a thousand examples of each of the handwritten digits. Then, instead of devising the rules ourselves, we can write an algorithm to learn the patterns from examples. Using this experience, the computer can then solve the same problem in new situations.
Essentially, our goal is to teach the computer to solve by example, very similar to how we might teach a young child to distinguish a cat from a dog.