Gente, como funciona a classe ProcessBuilder? E o Runtime?

Eu tava procurando um jeito de limpar a tela do cmd, e vi isso:

public static void main(String[] args) throws IOException, InterruptedException {
Scanner scanner = new Scanner(System.in);
System.out.println(“Teste”);
String texto = scanner.next();

    //Limpa a tela no windows, no linux e no MacOS
    if (System.getProperty("os.name").contains("Windows"))
        new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
    else
        Runtime.getRuntime().exec("clear");

}

Como eles funcionam? Pra que serve o inheritIO();? O .start(); e o waitFor();?