Hello @TannerJ2169 and welcome to our sweet community! Actually, we do not earn the gold in the Piggy Bank. Whenever we win a level, we gain some Stars, right?
The Piggy Bank converts those Stars as Gold Bars and stores them for us -- the players who would like to spend money and buy those Gold Bars will do it for a discounted price! It is not a must that we have to buy it. If we do not break the Piggy Bank, it will just stay there and whenever we open the game, tells us that it is available