With complicated algorithms it may not be obvious, but then you can try to poke the black box with thousands of sample cases to see how it reacts.
Compare this with humans, who often don’t even know themselves what their decisions are really based on.