question: bad luck in chess? I do not get it. Maybe I'm simplifying, but the program which gets deeper in the movement tree, should always win.
It doesn't always work like that. Usually, since examining, the whole move tree is very expensive, heuristics tend to kick in at various points providing assessments for positions (thus helping to prune the tree). It is quite possible to land in a position where your set of heuristics is not quite right.