When you add money as balance to your Apple Account, those funds will be used first for any digital subscription or digital purchase, before Apple tries to bill your credit card.
How to redeem your Apple Gift Card, or App Store & iTunes Gift Card - Apple Support
Add money to your Apple Account balance - Apple Support
How to check your Apple Account balance - Apple Support
Subscriptions are not tied to a specific payment method. These are independent. If you want to stay subscribed, then have a as-you-go payment method ready, optionally including account balance, at the moment of renewal.
Canceling a subscription will expire the access to the subscription content at the moment of next renewal, except for subscriptions during the free trial period. This latter type expires immediately when canceling.
If you were already charged for the upcoming 30 days, then canceling and resubscribing won’t made a difference for your credit card. That is in the past.