Offline and Online Zcash, Btc Addresses?

I’m curious about how the address generation works (specifically offline). How can we be certain or how is it possible that the same address never be duplicated especially offline where the software has no access to the web to verify that that address has never been created before?

The number of possible private keys is so large that randomly generating the same one twice will never happen.
Excellent video: Bitcoin 101 - Quindecillions & The Amazing Math Of Bitcoin's Private Keys - YouTube