A corporation is just a type of business structure set up so that the individuals owners don’t directly pay the taxes and aren’t responsible directly for liabilities. This allows multiple owners to invest and make profit whereas they wouldn’t be able to do it individually. If you own stock, you do pay the taxes indirectly because the corporate tax lowers your profit, and you pay directly when you receive dividends. ( double taxation )
If corporations go bankrupt as you are questioning, they would have to sell their assets and pay any bond holders and then the stockholders may get anything left.
So, any ‘owner’ would get anything left after paying the company’s debts? Makes sense.