The document discusses the state machine pattern as an alternative to using many if/else statements to handle an object's internal state. It describes a CarEngine class that uses if/else statements for its different engine states like OFF and RUNNING. This violates object-oriented design principles. The state pattern extracts each state into its own class like EngineOff and EngineRunning. The handle method is moved to each state class to encapsulate the behavior for that state and transition to the next state. This improves encapsulation over the if/else approach.