Private variables are encapsulated within an object to restrict direct access from outside that object, enhancing data security and integrity. They are commonly used in object-oriented programming to enforce data hiding and are usually accessed or modified through public methods defined in the class.