To find the answer to your question. I propose we analyze this all together.
Wang Anahi was relieved of his duty in 1074 and move to Jiangning, modern day Nanjing as a governor. He returned in 1075 for a second term as prime minister of Song and stepped down again in 1076.
His reforms fall into three categories. Education, Economics, and most famous is his Military reform.
Let's analyze Baojia, his military reforms. Wang Anshi proposed to the Song Emperor to train farmers into soldiers and provide them with weapons, necessary equipments including uniforms. One male from each household that have two males bodies in their household must enlist. Five hundred household would form a regimental unit of 500 men. These farmers would act as police during peaceful times and as soldier during time of war. This reform continues until the fall of Qing.
With his new reforms, Song military increased in size. Combined with his other unfavorable reforms as well as government loans to poor farmers, which a lot of farmers took advantage of, eventually bankrupted the Song's government and force them into war with their neighbors to make up lost revenue.
Like any modern employer, Song Emperor can't afford to pay the salaries of his large employment force without putting them to work.
@
dichoi , @
Grand Historian and @
Viet. Please let me know your thoughts on this.