First off, let me say that although this question is easily found on google...this type of question is probably one that many people have, and would benefit from hearing about someone has both education and experience in the field. Good question.
Okay...at little theory first.
Go here, http://dictionary.reference.com/browse/paradigm?s=t
Look at definition number 2. So...what does mean in computer science terms? Well there are two very well known paradigms that are in use today. Top down and object oriented.
The top down paradigm basically means that you build fully functioning modules by reducing the number of steps in your program though use of an algorithm. Each function should do only one thing, and you use the main program to control them.
Now...object oriented, expand on this concept. Yes, you still use functions, but in a very different (but similar way). You still reuse the same concept of functions...but you have a bunch of added stuff that you can use to improve the functionality (templetes, method overloading, abstract classes/virtual functions/interfaces). The job is to move from making each module a function...and "give it life". You model classes after real world concepts, and each class should have data fields (in OOP terms we these data members) and functions (in OOP terms we call these methods).
So...now lets start getting more technical.
Do you know what a struct is? Think about a second....
A struct is a "data structure" right? So...why is all the data in a struct declared as public? Well...this is a very dated version of encapsulation (one of the three main concepts of OOP...which are inheritance, encapsulation , and polymorphism). What happens if you declare the fields as private? Try it.
You can't access the data..can you? Did you get any compiler errors?
Well...lets expand a struct to include functions. We'll call this a class. So...what is a class? It's a data structure with functions. Now...we need to apply the concepts of OOP to this. So...we want to make functions have just what they need (inheritance), keep data private from things that don't need to screw with it ( encapsulation ), and make the function "generic" enough to change though subclasses if we need to (polymorphism).
Now, to answer your question.
There are three types of inheritance (also the access specifiers)...public, private, and protected.
In public inheritance...anything can access the private things (what is usually only data).
In private inheritance...the only things that can change the private fields are public things.
In protected inheritance...the only things that can change the private fields are public things (the same as private)...BUT....this stuff gets set as private if you declare a subclass.
So to actually answer your question, you use it because it follows the OOP guidelines, and for that reason only. You make public methods and use them to change the data in the private fields (gett and setter methods) You could in theory do the same thing with protected data members (use public stuff to modify the protected stuff)...but "many" claim that this breaks the concept of encapsulation as is discourages...but it's up to you to deteremine when to use this (I wont tell!)