How does the stock market work in terms of a business startup?

I'm trying to understand how the stock market works with a business. I watch a lot of Shark Tank and that's all centered around equity capital (with the occasional royalty or debt offer).

1) please explain, in the simplest terms possible, how equity works. My current understanding is that basically a "shark" like Mark Cuban who closes an equity capital deals is basically investing in stock in the company. If that's true, then I assume that the dividend that gets paid is in terms of the equity deal(s). For example, if there's an equity capital deal of 35% closed by one investor, the investor gets 35% of the dividend and the 65% is kept assuming there's nothing else that has to be paid dividend wise.

2) Please explain dividends. How is the "dividend amount paid" determined? Is it every penny of profit? Is it a pre-determined amount? If it's every penny of profit, then how are things like salary paid? Like say I own a company and we make a $200,000 profit. Say I pay myself a $50,000 salary. Is the dividend then calculated based upon $150,000 (again assuming no other expenses?)

3) Please explain the concept of shares in terms of a startup. How do you get shares, do you have to file something, apply for something..? How many shares do you get, how do you get more?

Basically my biggest question: In my naive mindset, I always thought that the business makes a profit and the profit gets stored in a bank account. Then the bank account can be used to pay salaries, expenses, upgrades, new hires, etc. I'm just confused with my pre-assumed mindset combining that with this huge idea of equity capital.

Thanks for your help!