Solving problems means achieving goals.
You cannot roleplay into succeeding at skill checks or casting spells that do stuff.
You need the ranks or the ability to cast that spell somehow.
Problem: That treasure is guarded by four lv1 guards and I'm lv1 amd I want that treasure
Fighter: I can swing a stick but it's 4 vs 1 It will not work. Cannot solve this problem
Rogue: I can use stealth or deception and then run. Difficult but I can solve this problem if I roll high enough.
Beguiler: I can make myself look like the owner, if something goes wrong I can make them sleep, or use grease and run, or simply use stealth. Piece of cake!
Different ways of solving problems. The fighter only has "hp depletion" as an option and becomes non relevant when that option is not viable.
Also in 3.5 caster classes are better at that as well making the fighter 100% useless