Craters form as the result of explosive eruptive activity at a volcanic vent where rock, magma, and other material is ejected leaving a conical void.
(hope this helps ^^)