Explain the difference between thread-safe collections and standard collections, and how would you implement thread safety in a custom cache?