If by "balancing" you mean retaining its horizontality or parallelness with the ground this was most likely done with an accelerometer.
Heres something to think about: each leg has a wheel on it right? Therefore if you want your robot to ALSO be a biped, you run into a big problem. If your robot attempts to walk on two legs, its feet will be wheels...hmmm...if you have ever looked at other Bipeds, you will notice that the feet are ussually very large compared to the rest of the body. The reason for this is to provide a large base, so the robot will not fall over. If you have wheels as the feet to your robot, to put it simply: your robot will never walk.
well not all the legs have wheels
the middle leg on both sides have longer length and more base
i have written
it can also walk as biped robot
this is where the longer legs comes to application
these legs have more base width for balance-
and these longer legs doesnt have wheels on them
when it moves as a car these legs will be working as a robotic arm
that is the 4th motor in these legs will be used for operating the grips instead of wheels
i havent quite decided about that
but in car mode the legs will be turned to upside
bcos it dont have wheels
4 wheels is enough bcos otherwise more friction hard to control and more motors
and an accelerometer how ?
could u explain it to me
and was i clear enough my friend
if u spotted any more problems in my idea point it out
but i say that it can walk