Each of the ghosts is programmed with an individual “personality”, a different algorithm it uses to determine its method of moving through the maze. Understanding how each ghost behaves is extremely important to be able to effectively avoid them.
It’s nerdy. Really nerdy. And a really interesting read. Head for the link.