1. value(forKey:)
The two are completely different. The value(forKey:) is not a UserDefaults-only method. It is enabled by the NSKeyValueCoding, which, According to Apple's Documentation:
NSKeyValueCoding is an informal protocol that objects adopt to provide indirect access to their properties. When an object is key-value coding compliant, its properties are addressable via string parameters through a concise, uniform messaging interface.
It happens that UserDefaults is NSKeyValueCoding compliant, so people have started (not necessarily in the correct way) using it for accessing UserDefaults.
2. object(forKey:)
This is the correct way to access UserDefaults's properties. Unless you do not have a very good reason to use value(forKey:), always use object(forKey:), or the other valid methods of UserDefaults (i.e. string(forKey:)).
Hope this clears things up!