Can someone explain voluntary commitment please?

Is it just for suicidal ideation/intent, or does self harm (cutting, burning - stuff like that) constitute committing? 

Also what is the process?

Really just any information on it… thx