Apologies, but the information you seek is not explainable in any simple terms. Learning Facebook Development can be a completely new learning curve, even if you understand the basic principles of webdesign (php/html/etc). Facebook is a whole new learning curve, even for experienced web coders. The only "simple" solution I can suggest is to begin studying Facebook Development principles, starting at the link I provided above.
As much as many of us might like to help you find the "easy" answer, some answers aren't easily explained. I'm afraid detailing FB Dev principles here in this forum might take days, and why rewrite the bible when its already been done.
Again, I provide a link to Facebook Development for your convenience...
Sorry I can't help more.