A group of workers come together. They form a collective known as a Trade Union.
They can say "pay us a better wage or we'll stop working for you". Or "stop managers from sexually harassing us or we won't do any overtime". They use collective bargaining to extract better value or conditions from their employer.
Some unions are tiny - they might just cover a single office. Others are huge - they might cover an entire industry. Because labour laws are complex it is sometimes better for people to be in a large union. There are unions which cover single companies and there are unions which cover industries. There are even "miscellaneous" unions.
Generally speaking, if a majority of workers vote to join a union then the company has to recognise that union (I'm glossing over the detail of what a majority means because different countries have different rules). Recognising a union means (again, depending on the law) that the company has to consult with the employees before making certain changes. It might also mean that the union gets to represent workers when negotiating pay.
In most countries, an individual can choose whether to join a union or not. If they don't join, they don't pay any union fees - but they also don't get the protection of the union's lawyers.
Some countries and industries allow for a "closed shop". That means you must be a member of a union in order to take a job. Normally, that means paying a monthly fee. Other industries are flexible - if you don't pay to become a member you can still do the job. You may even be able to take advantage of collective negotiation. But if you need legal advice, the union may not be able to help you. It's similar to insurance in that respect - you can't take out a policy after your house burns down.
Unions are democratically controlled and member run. They make choices based on what their membership votes for. Sometimes, the members may vote to go on strike e.g. "We will withdraw our labour until you fix this problem."
Some unions can engage in secondary action - in your example, let's say that the grocery store has been underpaying people. Union members might come and protest outside a store they don't work at in order to show support to those workers, to inform customers about the bad behaviour, and to let management know that their actions won't be tolerated.
Unions are necessary because your employer is richer, stronger, and has more lawyers than you do as an individual. In unity there is strength.