How a person ends up in immigration court in front of an Immigration Judge can be either voluntary or involuntary.
“Involuntary” generally means that that you have done something wrong where the person comes to the attention of Immigration Customs and Enforcement (ICE). For example, the person committed a crime and has been placed in criminal jail, ICE then picks him or her up and determined that they not eligible to remain in the U.S. ICE issues a Notice to Appear and puts the person in removal/deportation proceedings.
A person can end up in immigration court “voluntarily” by voluntarily filing an application that is subsequently denied. For example, a denied asylum application automatically sends the person to Immigration Court or a denied adjustment of status application for a green card may result in a NTA issued.