Who said it always plays the best moves? Its the strongest chess engine, but it still makes mistakes.
If stockfish plays the best move why does it lose games?

I will give you a metaphor example:
Imagine an idiot saying 2+2 =3, you would retorts the answer is 4 but the idiot doesn't comprehend why it's 4 and not 3.
It's the same with our mind and the same with software, we have what's we think it's the best but sometime, we're wrong without knowing it.
The allegory of the cave is a great example.
Bruh