You will owe penalty to file for year 1 and penalty for failure to file and penalty for failure to pay for year 2. Penalty for year 1 will be moot, since no tax is due, but the IRS doesn't know it until you file a return. If you don't - they'll "make up" a return on your behalf based on the information they have, and assess taxes and penalties based on that.
Refunds are not applied automatically. The fact that you think you have a refund (that IRS doesn't know of, since you haven't submitted the forms) doesn't mean you owe less the next year. However, if you're on an installment agreement or in collection, once the refund approved, it will be applied to your existing debt in other years before being distributed to you (what's left).
The penalty for failure to file is quite high, including interest. I suggest taking care of this ASAP, and I also suggest to have a licensed professional (EA or CPA licensed in your State) help you with this.