How do the lower circuit and upper circuit work?

It is explained in this thread too.