They've also built a reputation of producing quality students, and a network of employers associated with that. 18K is a fairly low price to pay for this, when you compare App Academy to the cost and time commitment of a university / community college program.
As for the tuition difference with age, I presume that a higher percentage of 22 year olds and under pursue a start-up job, where salaries are lower. Hence, they make up for the difference by charging an amount upfront.