The optimal decision tree
The balance has three outcomes, so each weighing can transmit one of three pieces of information. Two weighings distinguish up to 3 squared, or 9, states, enough for 8 balls.
Weighing 1
Compare balls 1, 2, 3 against 4, 5, 6.
Left heavy: suspect 1-3Balanced: suspect 7-8Right heavy: suspect 4-6
Weighing 2
If three are suspected, compare one against another. If they balance, the third is heavy. If two are suspected, compare them directly.