I have been reading quite a lot about SharePoint 2013/2016 lately and I am not sure I am able to see the difference between Farm Solutions and Provider Hosted App.
Please correct me if I am wrong:
Farm Solutions are custom code deployed directly on the SharePoint Server (They are Full trust Applications), but then I can't see the difference between sandboxed and Farm Solutions.
Provider Hosted App are applications that can be hosted on a complete different server and have to use S2S identification in order to be able to connect to the SharePoint Server (There are High Trust, user need to say he trusts this application) and are displayed in an IFrame to have a seemingly SharePoint experience using Chrome styling.
This will give you a history/backgroung about the different dev approaches for SharePoint.
And here's another (more technical) overlook:
Farm solutions (aka WSP) are packages physically deployed on the SharePoint server. They contain server-side code (C#) that has access to the entire SharePoint server API, meaning it can do a lot of things. A lot of components can be developed with this model: Web parts, event receivers, jobs, workflows, applicative pages, custom field types, custom forms, ... Almost no limit. This also means a "poorly-developed" application can highly impact the server (performance and security risks).
Sandbox solutions do use the same concepts but are limited, mainly in terms of the API you can use (+ they are resources-throttled by the system). So, it's a kind of subset of farm solutions. But same concepts, etc. They were introduced in SP2010 to allow developers to leverage their farm-solutions knowledge, while allowing some sorts of customizations in cloud-versions of SharePoint.
Then came the "Apps", now called add-ins. They appeared with SP2013, and sandbox were deprecated at the same time.
Add-ins are categorized into different types:
e. Auto-hosted add-ins: they do not exist anymore, Microsoft stopped them short after SP2013 release. Like a provider-hosted (oAuth) add-in, but with automatic deployment of the "third-party server" into Azure.
But we're now told add-ins are not that great, and a new (!) framework is released by Microsoft these days, called SPFx. For the moment it allows Web parts development only, but no more crappy concepts like app-web, IFrames, or else. But still "all client-side". And a lot of "new" tools, beside Visual Studio, to know about.