The difference manifests when the object you are copying contains references to other objects. A shallow copy just copies the references, meaning that the new objects still contains the same references as the old one. A deep copy also create a copy of the referenced objects. So for example if object A contains object B, then a shallow copy creates object A1 which references object B, while a deep copy creates object A1 which references object B1.
A deep copy is naturally risky since you can accidentally create an infinite recursion (if you accidentally copy circular references) or you just end up copying more objects than you intended.
All in all whether you need a deep or shallow copy depends on the context. The difference is whether object A “owns” object B or simply referenced. Logically, if A owns B then is should deep copy it, but if it just references then it should just shallow copy the reference.
Latest Answers