All the classes can do all the things, given the right resources.
The difference is that each class does something extremely better than the others.

Each class can do sustained damage, but a barbarian or a fighter are specialized in doing it. In the same fashion, every class can pick a lock or sneak around, a rogue is just twice as better in doing so (thrice as soon as they implement expertise).