The mind was created by self replication and competition over multiple generations (evolution). Self replication requires ability to adapt to environment, to collect energy and materials, to protect from predators. This was the playground where minds evolved. We're using similar techniques in AlphaGo, for example, where a sequence of players are pitted against each other.
Randomness is essential for exploration, which is a step without which we couldn't be intelligent. In reinforcement learning, the so called epsilon-greedy strategy of exploration says to select a random action with probability epsilon. It is a simple strategy that leads to intelligence. Of course, humans have smarter exploration strategies which nonetheless rely on randomness.