You missed the part where the defendant's lawyers provide the court the necessary evidence to convince the court that the total value of the bond is available to be confiscated if the defendant doesn't show. Which would apply in both cases you mentioned.