ptrace is used by debuggers (such as gdb and dbx), by tracing tools like strace and ltrace, and by code coverage tools.
By attaching to another process using the ptrace call, a tool has extensive control over the operation of its target.