In a nutshell: it allows you to create an HTTP tunnel (and other types of tunnels). In this mechanism, the client asks an HTTP proxy server to forward the TCP connection to the desired destination, meaning that you can expose your local web server through a public URL.
Such tunnels are useful to test webhooks in local for example.
How Does it Work?
You download and run a program on your machine and provide it the port of your web server.
It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.