Weight distribution is critical, and it is a bit of a fine balance, much like doing a track stand.
I find that it is easiest to do this by staying seated and crouching towards the front of the bike.
Standing on the pedals will tend to put your weight too far forward and make it difficult to achieve smooth power transfer to the wheels.
Smooth Power Transfer is another important aspect.
Remember that your rear wheel only has a small amount of friction keeping it from slipping.
What you are trying to do is keep the pressure on the pedals strong enough to keep you going up the hill, but not so strong as to make the wheel spin.
Things that can help with this are: Staying in a seated position Concentrating on pedalling in smooth circles, rather than a in separate pushes from each foot Using as high a gear as you can manage while still maintaining a reasonable cadence.
If you are using your lowest granny gear, it is much easier for your legs to overpower the friction between the tyre and the ground.
Balance , working on your low speed balance by practicing track stands and the like will mean that you are less likely to need to put a foot down, and more likely to be able to recover from a brief "halt" in your progress.
bicycles.stackexchange.com/users/350/deemar
The back wheel is spinning because there's not enough weight towards the back of the bike because you are not sitting on the seat.
A technique that works well for me is to hold the handle bars in such a way that your elbows are pointed down towards the ground.
This makes sure you stay low and puts pressure on the back wheel.
Also, don't forget to KEEP PEDALING!
;)
If you trust in yourself and don't stop pedaling, you can sometimes recover from a back wheel spin or even a dead stop.
bicycles.stackexchange.com/users/561/Ken Aspeslagh
This is about fore and aft weight distribution.
Also means you generally won't be sitting.
When your rear wheel spins, you have too much weight distributed forward.
And when your front wheel lifts, too much in the rear.
What to do?
Find a hill and practice distributing your weight until you find the sweet spot where you are neither spinning the rear or lifting the front.
Then there's always the cyclo-cross technique where you pick up your bike and run up the hill.
bicycles.stackexchange.com/users/None/
From my experience on slippery roots with hard MTB, it is critical to: lift your weight from the wheel hitting the obstacle
(that's what full suspension does for you), like you (should) do when hitting the curb, have appropriate tires (not just tire pressure), ...except for already mentioned: smooth pedaling, weight distribution (low center weight), balance (sideways).
bicycles.stackexchange.com/users/406/dhill
As mentioned the balance (front/back) is key, but there are a few other things that help:
Full suspension - the rear suspension limits wheel bounce when going over obstacles, this helps to prevent the rear wheel spinning out Reduced tyre pressure - same concept as above Bigger wheels - I have found climbing rocky stuff easier on my 29er than on my 26er Practice...
bicycles.stackexchange.com/users/126/Richard Tasker
When mountain biking with my friends, we sometimes end up tackling a severe up hill over rocky ground.  I usually find I end up putting a foot down first. I'm not sure what's going wrong. Sometimes my back wheel spins and I lose power and stop, or my front wheel lifts up and I somehow lose balance and end up going off to one side.  What techniques can I use to get further up hill before I lose it?  Thanks.
How do I cycle up steep rocky ground?
bicycles.stackexchange.com
<mountain-bike><technique>
bicycles.stackexchange.com/questions/1360
bicycles.stackexchange.com/users/472/Scott Langham
When cycling up steep hills, weight distribution  is critical, and it is a bit of a fine balance, much like doing a track stand. It is important to keep enough pressure on the pedals to keep moving forward without causing the rear wheel to spin. You should stay sitting down and keep peddling. Practicing track stands can help with getting the right weight distribution. One of the main aspects of cycling up steep rocky ground is finding balance through weight distribution. You can follow a number of techniques towards this end, such as standing on the pedals, staying seated, pedalling circularly, using high gears and practising track stands. You should also practice transferring power evenly and continue pedalling regardless of the circumstances. Moreover, some user advise putting pressure on the back wheel by changing  the handle bar hold, so that elbows are looking to the ground. From a technical standpoint, you should use a bike with full suspension, low tire pressure and bigger wheels for better performance.
One of the main aspects of cycling up steep rocky ground is finding balance through weight distribution. You can follow a number of techniques towards this end, such as standing on the pedals, staying seated, pedalling circularly, using high gears and practising track stands. You should practice transferring power evenly. You could try putting pressure on the back wheel by changing  the handle bar hold, so that elbows are looking to the ground. It is important to continue pedalling regardless of the circumstances. From a technical standpoint, you should use a bike with full suspension, low tire pressure and bigger wheels for better performance.