For The Army:
Aside from psychological problems or disciplinary problems you had to pass some tests before graduating.
1. Marksmanship. If I recall correctly 70% hits on timed pop up targets from 25 to 350 yds.
2. Bayonet course. Demonstrating the ability to parry, thrust and stab with the bayonet, and use the butt of the rifle to in two butt strokes.
3. Physical Fitness course. 5 tests. Low Crawl, Run Dodge and Jump, Mile Run, Horizontal Ladder, and Grenade Throw.
Fail minimum performance on any of these tests and you got "recycled", which means you started over and did basic again.
We were also told you had to successfully negotiate the Obstacle Course, but I had my doubts as it was done at night and in company sized groups so it was not observed closely.
I seem to remember you could get recycled twice before you were discharged "Unfit for Military Duty", but that might have been barracks rumor.
I also found that other Basic Training camps had a different mix of the PT tests. Mile Run seemed to be in all of them and often Run Dodge and Jump, and Low Crawl.