The stock market in every country is regulated by a regulatory body, for example in India, the body is SEBI. the market functions by the guidelines of it and the bodies regulate stock exchange, transparency in the market, and protect the rights of investors.
This means that when an investor invests in the stock market, not only his money but also his rights are protected by these regulatory bodies. This saves them from any kind of fraudulent activity done by the company they have invested in.
This makes the investments even secure and gives the investors the confidence and trust of no mishappenings.