Occasionally, a problem will be discovered shortly before departure. This is usually caused by the flight crew going through their pre-departure checks. During those checks, backup systems are activated to ensure they function properly. Pre-flight checks are executed while the passenger and cargo are being loaded. If a problem is discovered during the checks, maintenance is notified. (travel.usatoday.com) More...
Well Jackie as the usa today article said from the pilots view that is correct and what else happens is that in the event of something doesnt pass on the "checks" and the back up systems dont pass thats when we hold everything at the gate.
then the process of checking a go / no-go list is reviewed with a team of maintenance people captain of the flight and others if it is a no-go then we try to fix the what ever the no-go item is and let the plane depart.
sometimes we dont know a part is going to break until the engines start, so again a delay so i hope this answered some of what you asked there is a lot put into you safety by all of the folks that make flying a great time