I guess the obvious problem is that a person going to therapy may not feel sufficiently secure to be comfortable formally detaching. How are such cases noticed and approached?
In cases like this, it helps if the end condition is discussed early on in therapy. If this worry comes up, it becomes important to find out where this insecurity comes from. Many therapists will have an open door policy -- if we decide your goals have been met and we terminate, you can at any time come back and decide to start therapy with me again. If termination is due to the therapist leaving, they can refer the client to someone new. In some cases (though this is easier in a clinic) the gap can be bridged by having a session dedicated to the old therapist introducing the client to the new therapist, and helping create that bond before detaching from the client.
Can you give more details on termination when the patient and therapist feel there is no longer need for therapy? How does one recognize that situation? What is the end goal of therapy? Do you need to be fully healed, or is it when the therapist can no longer teach you any new skills?
Usually, therapist and client talk about goals early on in therapy. This depends a lot on what the therapist's expertise is and what the client sees as being the major problem. A client could come in with PTSD and say their major goal is to not have flashbacks anymore, or with social anxiety and have the goal of being able to approach new people without having a panic attack. It may not necessarily mean the end of therapy (could continue with new goals or see someone new or just stop, depending on what the client wants).