A Facebook application is actually a web ( or mobile ) application which runs either within Facebook ( mainly via tabs in pages ) or generally via your browser and requests that you log into that application via your Facebook profile. There are applications though that may not be of that pure and good nature which you may want to avoid. You see, each time you are about to open a Facebook application for the first time, Facebook asks you whether you want to grand access to that application use some of your data or/and be able to perform some Facebook actions impersonating yourself.
There are applications that are spammy, maybe of bad nature that many users pass by as they don't really pay attention to what that application requests. There is something really bad that can happen when you grant access to an application that you don't know or cannot be trusted. The least that can happen is that this application may spam all your friends. This app can get your friend list and thus bother them, it can post on your behalf, it can even take control of your pages if you are a page manager.
So we need to avoid such applications and also we need to review the apps that already have access to our profile. To do so, we can visit : https://www.facebook.com/settings and then open "Apps" or visit this page here : https://www.facebook.com/settings?tab=applications. There you will see a list of the apps that have access to your Facebook profile :
If you click "Edit" in one of the applications there, you will be able to see what this app can do with your profile and edit some of the options you have on how this app can interact with Facebook via your profile, something like this :
Here, you can change how this app is visible or not via your profile. Also you can remove its credential to post on your behalf. Of course, an app may request it again but this is way to handle your apps. Also, you can completely remove this app and all of its activity on Facebook related to your profile :
Next time you visit this app, it will again request you give access to it with the standard popup ( AJAX really nowadays ) window that looks like this, asking for the "Standard Permissions" :
and then it will ask for what are called "Extended Permissions" :
Here you can either skip it or allow it by selecting who will be able to see the posts this app does for you ( should you allow it of course ).
So basically, you have all the tools you need so to manage and handle your Facebook applications and this is a process you should do, review them all from the list above and remove the ones you don't know, to avoid having your profile and more importantly, your pages, exposed to dangers coming from apps that are either compromised or spammy.