As you may know, 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 to the person’s Facebook profile such as interactive games, quizzes and many other random things which stop people from doing work or whatever they were doing beforehand.
When somebody adds an app it gives access to that app access to the 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”).