It's difficult to say when the first real labor strike occurred. The word "strike" was first used in the 1700s, and probably comes from to notion of dealing a blow to the employer [ref]. In 1786, a group of printers in Philadelphia requested a raise and the company rejected it. They stopped working in protest and eventually received their raise. Other professionals followed suit in the next few decades. Everyone in a city who practiced the same profession agreed to set prices and wages at the same rate. Members would shun anyone who diverged from the agreement, refusing to work in the same shop and forcing employers to fire them. By the 1800s, formal trade societies and guilds began to emerge.
To have a strike today, you must have a union (though not necessarily an official union) -- an organization of workers that bargain collectively with an employer. Workers form unions because an individual worker is powerless compared to an employer, who can set low wages and long working hours as long as it adheres to labor laws. When workers combine to form a union, they collectively have enough power to negotiate with the employer. The main weapon the union has against the employer is the threat of a strike action.
At its most basic level, a strike occurs when all the workers in the union stop coming to work. With no workers, the business shuts down. The employer stops making money, though it is still spending money on taxes, rent, electricity and maintenance. The longer the strike lasts, the more money the employer loses. Of course, the workers aren't getting paid either, so they're losing money as well. Some unions build up "war chests" -- funds to pay striking workers. But it isn't usually very much, and it's often not enough for a prolonged strike.
Strikes help explain why unions are more powerful than individuals. Imagine if an employer refuses to give a raise to an individual worker. She then decides to stop coming to work in protest. The employer simply fires her for not coming to work. That one worker has no power to influence the employer. However, it can be very costly for an employer to fire every single worker when a union goes on strike (though it has happened).
For a strike to occur, the union's leadership must call for a strike action. They won't call for a strike unless the union members have voted for it. Each union has different rules that dictate what percentage of the union must approve a strike, but 80 percent is typical. If union members strike without official approval from union leadership, it's a wildcat strike.
Of course, a strike doesn't happen every time a union member and the employer have a disagreement. For minor matters, the union can file a grievance (following a set procedure included in the contract between the union and the employer). When it is time to renegotiate a contract, both sides will usually sit down and try to come to an agreement. Unions try to exhaust all other measures before resorting to a strike for two reasons: union members usually lose money and it's the last thing that unions can do to get employers to agree to their terms.