Quoting the Rack documentation:
Rack provides a minimal, modular, and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.
Rails applications need a web server in order to interact through the HTTP protocol. And since the early days, the Rails community has seen a huge range of web servers available to deploy applications.
Early on, Rails was responsible for providing an adapter to each web server it supported: one for Mongrel, another for WEBrick, another for Thin, and so on. Similarly, other frameworks ...