In Freuds theory of personality

The ego operates by primary process thinking

The ego obeys the reality principle

The id operates by secondary process

The superego obeys the pleasure principle