The gnawing creatures, during the breaking of Thangorodrim, began squirming in all directions - underground, of course - just like an bugs when you strike the nest. The balrog, being the only one that survived, obviously was a bit brighter than the others, and so followed the gnawing ones out away from the battle.
Eventually, the balrog could worm no more, and so lay down for a sleep in some cavern under Caradhras...that is until some hammer-banging Dwarves showed up...