This was done in a hurry, so any spelling mistakes, please don’t bother me with.
As you may know that Facebook is a social network website in which people can contact other people (Such as friends) and interact with them. On Facebook people can add apps which add many new things onto the person Facebook profile such as interactive games, quizes and many other random things which stops people from doing work or whatever they were doing before hand.
When somebody adds an app that it gives access to that app access to your personal details that you likely have inserted into Facebook. That app can record all your details into a database and the creator of that app can then do whatever the person wants to do with it (Didn’t say “legally”).