A good exmaple is you amking a sandwich. I bet you;ve never been taught the exact routine. You had an ideo fo the inputs (filing, spread, bread, taste). You then tried it, it was horrid (who wants marg in a sandwich), adapted it, and created a complex algorithm that makes a nice sarnie. I doubt there's a set of rules, but you know exactly how to do it. It's also adaptable...make in in someone's kitchen? Reckon you could. Sliced turkey instead of ham,? You;'d make it ok as a 'best case scneario' with what yuo have.
Computers would learn exactly the same way. They not teach it how to mkake a sandwich, but teach it the basics, teach it what tastes nice, and let it learn. It would take an awful lot longer and have some horrbie sandwiches during testing but the end result with a perful enough computer would be some yummy sandwiches.