Read the following articles, which describe the GMM in great detail:
1- David Roodman, 2009. "How to do xtabond2: An introduction to difference and system GMM in Stata," Stata Journal, StataCorp LP, vol. 9(1), pages 86-136, March [http://ageconsearch.umn.edu/bitstream/122704/2/sjart_st0159.pdf]
2- Using Arellano – Bond Dynamic Panel GMM Estimators in Stata (xtabond and xtabond2) [http://www.fordham.edu/economics/mcleod/Elitz-usingArellano–BondGMMEstimators.pdf]
3- DPD (Dynamic Panel Data) By Christopher F Baum [http://fmwww.bc.edu/EC-C/S2013/823/EC823.S2013.nn05.slides.pdf]
I am still reading about GMM and I think you will understand it once you finish from reading the articles.