4A is the cheapest inside cabin on the lowest deck, 4B is a deck higher etc etc until you reach 4G on the highest deck. They aren't all on the same deck - check out the deckplan on carnival.com website.
The difference in the grades is usually what the cabin has to offer could be sleeps 2, or sleeps 4 with pulldown beds! Window view, porthole view,obscured view, balcony etc and even whether the cabin is Midship, Aft or Forward. If unsure the travel agents will be able to tell you the grades on the decks.
Location Location Location.