The first example (space-separated classes) is a parent-child relationship. .classB is found inside .classA.
<div class="classA">
<div class="classB"></div>
</div>
The second is for one element with multiple classes, like so:
<div class="classA classB"></div>
Very different situations, but both extremely useful!