Machine learning is a subfield of computer science that allows computers to learn without being explicitly programmed. It builds models from sample data to make data-driven predictions or decisions. Machine learning is used for tasks like spam filtering, intrusion detection, optical character recognition, and computer vision. It involves supervised learning from labeled examples, unsupervised learning to find patterns in unlabeled data, and reinforcement learning where a system interacts with an environment and receives rewards or punishments. The goal is for the learning system to generalize from its training data to perform accurately on new examples.