thread control over the lock order java

Account fromAcc, Account toAcc, int amount){
     synchronized (fromAcc) {
          synchronized (toAcc) {
              fromAcc.debit(amount);
              toAcc.credit(amount);
     }
   }
}

A: TransferMoney(checking, saving, 10); B: TransferMoney(saving, checking, 20); No control over the lock order. Depends on the caller (Why???)

Solution is here

int fromHash = System.identityHashCode(fromAcct);
int toHash = System.identityHashCode(toAcct);
if (fromHash < toHash) {
synchronized (fromAcct) {
synchronized (toAcct) {
new Helper().transfer();
}
}
}else if (fromHash > toHash) {
synchronized (toAcct) {
synchronized (fromAcct) {
new Helper().transfer();
}
}
} else {
synchronized (tieLock) {
synchronized (fromAcct) {
synchronized (toAcct) {…
}
  1. My question is what is control over the lock and why there is no control over the lock on pic one?
  2. If they access two locks, then how do they release? What is the difference between this and dead lock? Also, how thread acquire multiple locks work?