It did because they made the producers produce more and more goods, and the more they produced the more they would earn. Production speed was also an important factor as everything had to be made quickly and in large numbers.
Confucianism stresses social structure and the obedience to the one superior to oneself: wife to husband, child to parent, but also subject to ruler. So teaching Confucianism effectively taught the people to obey their leaders, the Han!
They used it to control their government.