What does JAGS from package rjags do?

I was skimming over a dirichlet multinomial naive bayes model a friend made. I'm somewhat new to this.

From my understanding, JAGS performs "bagging", or samples from different starting points, using Monte Carlo Simulations.

Am I right? Could someone explain it like I'm 5?

Probably these links will help
http://www.bayesianscientific.org/resource/jags/