How do Proxies avoid storage collision

I have a question regarding the proxy contracts. How come when we use the sstore opccode and store variables in proxies , it does not collides with the storage of actual logic contract ? how is it so random ? , it it because the constant slots are initialised with string values ? does that make storage slot random enough ?

The storage slots used by the proxies are set according to EIP1967.

That EIP specifies specific storage slots that are "chosen in such a way so they are guaranteed to not clash with state variables allocated by the compiler, since they depend on the hash of a string that does not start with a storage index."