Car loan payments are paid in arrears, which means you are paying for the past month.
When you trade, the dealer will call your bank and ask for the current balance, which might include an unpaid monthly payment. This is the amount that the dealer will pay the bank to "buy" your vehicle. Now, if that amount is less than your car is worth, he'll CREDIT you with the difference as part of your down payment on your new vehicle. However, if the amount is more than your car is worth, you are "upside down" and you must PAY the difference as part of your down payment.
Once the dealer pays off your loan, you no longer need to make payments. However, it sometimes happens that dealers don't get around to paying off your loan immediately, which means you must keep making payments meantime. Of course, your payoff will be less by the time the dealer gets around to it, and you'll somehow get credit for it, assuming the dealer is honest and doesn't decide to keep the difference for himself.