I am wondering, how JAGS performs Gibbs sampling (i.e., how to sample from
the complete conditional distributions when they're not available in closed
form). How does JAGS perform gibbs sampling different from BUGS?
We don't need to sample directly from the full conditional distribution. All that is required is to make a reversible transition that is in detailed balance with the full conditional. This is much easier to achieve;the main method used by JAGS is slice sampling. For multivariate continuous distributions we sometimes use random-walk Metropolis-Hastings.
As for how JAGS and BUGS differ in their sampling approaches, this is not an easy question to answer. I know that BUGS uses adaptive rejection sampling for log-concave distributions, which is not implemented in BUGS.