Each barracks can make 1k soldiers a day. You may only build a maximum of 1/3 of your total maximum a day, i.e, if you can build 9k soldiers in total [3 barracks], you can only build a third of that per day, i.e 3k soldiers.
If you have a population of 300k people, 45k of those people can be soldiers, which is 15 barracks worth. If you build more than that, i.e 20, you can still only build 1/3 of your ''capable'' amount [i.e 45k total, 15k per day]