Encapsulation in JavaScript restricts direct access to some object components and bundles data with methods that operate on that data. It provides security through controlled access, hides implementation details while exposing behavior, and allows loose coupling by modifying implementations freely. Private members and methods can only be accessed within an object while public members and methods can be accessed anywhere and by anything. A demonstration of encapsulation in JavaScript was presented.