Blockchain systems ensure randomness through cryptographic techniques and consensus mechanisms essential for functions like generating cryptographic keys and distributing rewards fairly. They utilize consensus algorithms that incorporate unpredictable elements, such as timestamps or transaction inputs, to generate randomness. Participants can also contribute random values to create a combined output. These cryptographic measures enhance security and resistance to manipulation, promoting fairness and making it challenging for any single entity to control outcomes.