There are many reasons that may cause the court to believe that you should lose custody. These reasons can be divided into administrative, behavioral, and safety categories.
Administrative reasons that custody may be taken away include disobeying court orders, subverting custody arrangements, or failing to appear before the court. Behavioral reasons for losing custody may include attempting to alienate the child from the other parent. Finally, you can lose custody if you are shown to act in ways that endanger the child such as misusing drugs or alcohol or acting in abusive ways.