An engine wouldn't be an engine if it could not find the best moves by itself.
The reliability of the engine depends on the depth. Also the engine evaluation of a specific move is better after the move is played. So it is more likely that it is implemented as I said, because that is the best way to do it.
An engine wouldn't be an engine if it could not find the best moves by itself.