Are pledges collected immediately or after project is funded?

One thing that just occurred to me after purchasing and installing the plugin is what happens if a project isn't funded by a particular date.

Does a pledge to fund come out as soon as they make it or does it come out after the project is backed? How does that work?

If a project isn't funded is all the money returned or does that have to be done manually?