Lets start with cleaner code. Classes let you encapsulate a bunch of related functions with the data they work on. You could of course use a bunch of functions and pass data to them, return new data from them. But it is much much cleaner (and easier) to have a class that has all of the data self-contained. It also lets you hide certain data that isn't meant to be touched or used. For example, if you have a simple class Counter that counts upwards then the actual number that the counter holds shouldn't be changed. By using a class you can easily make variables private or protected.
But that is only one small part of why classes are useful. Two others are inheritance and polymorphism.
Inheritance lets you define a class that has "children" (subclasses) that inherit all of their properties and methods. For example, you have a "thing" in your program that can be of different types.
A practical example: Say your CMS has three different types of users. An Admin, an Editor and a User. You might define a base User class but extend the class for Admins and Editors to include additional (or different) functionality. You could do this procedurally but not efficiently. In your authenticate_user() function you'd need to include a conditional to see if the user is an admin and check if they have access to the ACP. What if 6 months down the line you decide to add a Super Editor or something? You need to go into every function with such conditionals and make another change. The more changes you have to make, the longer it will take and with better chances of introducing new bugs. If you do things in OOP then you just need to create a new subclass of user.
The next big feature of OOP is polymorphism. That is the ability to use different objects that are of different types as if they were of a single type. Going off of the User example above, each type of User shares common properties and methods.
For example, when logging in your code might call $User->authenticate(). It doesn't matter if the user is an admin, an editor or a normal user because all of the different types of users have an authenticate method. The different types of users might have dramatically different routines for authentication but it doesn't matter. Since you program to an
interface, the code that uses your classes never needs to know which type it actually is.
Another popular example is with animals. You might have classes for a Dog, Cat and Bird the are children of a parent Animal. The Animal class has a method makeSound() that each child overrides. This allows you to create code that expects "any kind of animal". For example:
PHP Code:
$animals = array(new Dog, new Cat, new Bird);
foreach ($animals as $animal) {
$animal->makeSound();
}
Using classes with inheritance and polymorphism gives you some real power in the design of your applications that you simply cannot get with procedural style programming.