Encapsulation ensures that fields within a class are accessible only through methods, protecting the internal state from unintended changes. For example, a `Product` class might have a private `price` field, accessed only through a `getPrice()` method, ensuring changes can be validated.