You want to know the purpose of encapsulation in OOP and how it works in C#.
There are two reasons for encapsulation. The main one is information hiding. Information hiding is enforced by restricting direct access to an object’s members. The second reason for encapsulation is grouping related data and methods together. A “capsule” is created when data and methods (the operations performed on the data) are coupled.
In C#, encapsulation is implemented through the use of access modifiers and properties.