Hello, welcome to FlyerTalk!
Airline fare classes/codes can be a confusing thing at times, but rest assured most of it is justified. Rather than try and explain it all here -- since it can be rather complex -- I'll provide some helpful links for you to look over. Hopefully they'll answer most of your questions, and if you still have more, please ask.
Wikipedia - Travel Class
What's in a Fare?
Learn the ABCs of fare classes...
faqs.org - fare classes
Guide to Airfares
That should get you on your way. Please do read at least some of those links. They will contain most of the information you probably are looking for, and any specific questions you have could be directed back here.