The bank reconciliation compares the amounts that are on the bank statement with the amounts in the company's general ledger Cash account. The goal is to be certain that the correct amount is reported as the balance of the Cash account. (If the Cash account is incorrect then the amount of another account is also incorrect due to double-entry accounting.)
Often the company's cash account is not correct because there are some transactions appearing on the bank statement that have not yet been recorded. For example, the bank service charge, check printing fee, returned checks, returned check fees, loan payments, and interest earned, are on the bank statement but have not yet been recorded in the company's Cash account. These items must be entered into the company's Cash account and into another account because of double entry accounting. For example, a bank service charge will need to be entered on the company's books by crediting the Cash account and debiting Bank Service Charge Expense or Miscellaneous Expense. A customer's check that has been returned NSF (not sufficient funds) would be entered in the company's accounts with a credit to Cash and a debit to Accounts Receivable.
The ending balance shown on the bank statement is probably not the correct amount of cash either. The reason is that some of the amounts in the company's general ledger will not yet appear on the bank statement. For example, as soon as a company writes a check, it will appear as a credit in the company's Cash account. However, the check might take a week before it reaches the bank for payment. These "outstanding" checks need to be deducted from the balance on the bank statement in order to get to the correct amount of cash. Occasionally, there will be a day or two lag between the date the company records a receipt in its Cash account and the time it gets posted to the bank's checking account records. These "deposits in transit" will need to be added to the bank statement balance in order to find the correct balance of cash.
After the adjustments (and perhaps corrections of errors as well) are made to the balance of the company's Cash account and to the balance per the bank statement, the two adjusted balances should agree. If they are the same, you have reconciled the bank statement.
Petty cash is a small amount of cash that is available for paying small amounts without writing a check. If the petty cash fund is "imprest" at $100, the company's general ledger account Petty Cash should have a constant balance of $100. At the end of each accounting period and whenever the currency in the petty cash fund is low, the petty cash fund is replenished. To replenish the fund, a check is drawn on the company's Cash account and is cashed at the bank. The amount of the check is the amount needed to get the currency and coins on hand to be equal to the imprest amount. The Cash (not Petty Cash) account is credited for the amount of the check. The amounts on the petty cash receipts or vouchers will be debited to the appropriate accounts such as postage expense, travel expense, etc. Any difference between the amount of the check and the amount of petty cash receipts is recorded in the Cash Short and Over account (a miscellaneous expense).