This is a simple representation of the SharePoint Object Hierarchy. Each of the constituents is described below.
A SharePoint farm can be defined as a collection of SharePoint servers that share common resources and work together to facilitate a set of basic SharePoint services and functions to support a site. It can provide failover capabilities, scalability, performance, etc. An organization can have a farm that supports separate SharePoint farms for separate geographical locations, such as a farm for Asia operations, another for European operations, etc. It helps to organize different policies with respect to organization of content, customization, and support of SharePoint. Another example could be a separate farm for internet and intranet sites or a separate farm for disaster control, etc. The organization might use shared services among different farms. A SharePoint farm has its own configuration database.
A SharePoint web application is a top level container. You can create a web application using SharePoint Central Administration. It creates an IIS website and a content database behind the scene. The web application’s settings are stored in the configuration database. Although there is an IIS site that gets created, web applications are maintained using SharePoint Central Administration, not from IIS. You can auto setup when a new web front end joins the farm based upon the settings in the configuration database. It creates a home directory on the web front end (WFE) (e.g., C:\inetpub\wwwroot\wss\VirtualDirectories\internet80).
A managed path is a location within the scope of web applications and is used to create site collections. A managed path can be used to categorize, organize or group together site collections. On a web application, an explicit managed path defines an exact path so that a site collection can be directly attached. An explicit managed path can have only one site collection. A wild card managed path defines a path that cannot have a site collection directly attached to its root, but can have more than one site collection assigned beneath it.
A site collection is a primary scoping mechanism for resources. It is mainly used to provide a grouping of SharePoint sites. A site collection shares a content database with other site collections within the same web application; however, they can have their own dedicated content database. A site collection is made of one top level site and all other sites below it. It is a host for the site collection based galleries such as list templates, SharePoint groups, sandbox solutions, themes, users, web part templates, workflow templates, site features, site collection admins, etc. It also acts as a host for hierarchical web based galleries such as site columns, content types, master page, web features, etc.
This post provides a very high level description of how different objects fit together in the SharePoint hierarchy model and how we can leverage this knowledge while designing, organizing and developing custom applications or content.
References: MS Technet and Wikipedia