This question can lead to a long discussion. The typical hubmotor kit is aimed at street riding, with grades typically not much over 5%, and can tackle 10% if it must. If you have less steep trails, then no problem. If you want to ride up 15% grades or steeper, then you have a problem with a hubmotor.
What happens is that as the grade steepens, the 800 watts or whatever is not enough to keep the speed up. At some point as speed at full throttle drops, the motor begins to get less efficient. This begins a bit of a death spiral where as you get slower half your power starts heating the motor instead of just 20% of it. So the 800w is now 400w, which makes you slower, which makes the motor make even more heat which makes you slower which......... Till at some point while you are riding 5 mph or less, the motor burns up.
How do you fix this? Three things to do can help.
One obvious one is gear down. Only one way to make a hubmotor shift to a lower gear, that is use a smaller rim. So some rebuild bikes to take 20" wheels, or use a BMX bike.
The other obvious one pour on the power. Even with the 26" wheel, serve up 2000 watts instead of 800 and you will go faster up that hill. This can work quite well on grades 10% or less for sure. Often part of the way to do it is to increase voltage. Just going to 48v instead of 36v gets you about 300w more, and might be all you need to get up 10% grades just fine. There are oversize motors out there that tolerate 3000w easily, and with 3-4 hp you can climb some hills with pretty good speed, keeping the motor in the more efficient rpm.
The last, somewhat less obvious method is to use a slower wind motor. This motor is designed to go slower, and therefore has a better tolerance for speeds under 15 mph. It costs you top speed, and a really extreme slow motor may require you to increase the voltage a lot, to avoid having a bike with a top speed under 15 mph. The slow motors can be hard to find, but one that can be bought easily is the Mac gear motor from cellman.
The 12T version of the motor will get up hills with less heat waste than the faster motors.
My own approach has been a combination of the more power approach and the slow motor approach. I have used direct drive motors of the 9 continent brand, in their slow and very slow winding models. The 2810 model run on 48v goes about 20 mph max, and climbs 15% grades just fine with light pedaling. My favorite though, is the extremely slow 2812 motor, which I run on 72v. 25 mph top speed, but able to climb crazy steep hills for a mile or so before melting down. By limiting the wattage to 1500w I have no problems, but I have at times doubled that to 3000w. At 3000w, with a 72v 40 amps controller, you pretty much never pedal unless it's up a grade of 30%. But you do have to watch it how long you climb really steep grades. I have several motors, and often have one running while another waits for melted hall sensors to be replaced.
Batteries for dirt riding tend to be RC lipo type in the last few years. We want power, and we want it light. The possibility that the batteries might catch fire is not part of the decision, but once you do go for RC lipo, you want to be very careful how you use them, store them, and charge them in a place where a fire won't result in dead people. You don't just plug in and go to sleep with lipo.
Other types of battery might be OK, but the weight may result in a bike that handles less nice. It depends on the difficulty of the trails you ride, how much handling matters. In the rocky mountains where I live, I try to have the bike handle as good as I can afford. So I run lipo.
Here is a pic of my dirt ride. It's a cheap bike, but I upgraded both shocks to make it ride tolerable. I carry the batteries on the front to keep the handling good.
Link to video, I have quite a few vids on Y tube, showing how it can get up a rocky hill pretty good. With heavy pedaling, it finally gets stopped at about 20 degrees. Not sure what % grade that is, but it's rock crawler 4x4 or mine roads.