In June 1775, about two months after Lexington and Concord, the Continental (American) army was still holding Boston in siege. Boston was surrounded on three sides by water, and on the fourth by the Continental army.
The British army was well trained and many had been involved in the wars in Europe. The British could have left Boston by water, but they neither had enough ships nor enough interest to do so. The British troops considered the militia and Minutemen as a bunch of poor, ignorant farmers, with old muskets.
Militia vs Trained Army:
The colonists were not a trained army. They were a militia, kind of like the national guard. They drilled on weekends, but they did not have the same weapons as a true army. In fact each militia member was supposed to supply their own rifle.
The colonial leaders learned from their spies that the British were about to send troops out to occupy the hills surrounding Boston. From there, they could shoot more effectively at the militia and Minutemen who had blocked them in.
Artemus Ward, general of the Massachusetts army, sent about 1,000 men to Charleston peninsula at night, to fortify the hill before the British arrived. Charleston peninsula is right outside of Boston.
The men he sent, led by Colonel Prescott, decided to fortify Breeds Hill instead. Breeds Hill was about a third of a mile (about 1300 feet) from Bunker Hill. Breeds Hill was lower, and within artillery (canon) range of Boston.
When the British woke up the next morning, they found Breed's Hill swarming with Minutemen.
About 2,000 British troops quickly sailed from Boston to the peninsula. If some of the British troops had sailed to the mouth of the peninsula, they might have been able to trap the Americans on the peninsula when they ran out of ammunition, but the British did not do that. The British had heard that the colonists had canons. They did not want to risk their ships.
When they landed on the peninsula, the British ate lunch. That gave the Minutemen more time to fortify the hill by digging trenches to better protect themselves.
Colonel Prescott of the colonial militia warned his men: "Don't fire until you see the whites of their eyes." This quote is famous, and possibly legendary. (This quote is also attributed to Israel Putnam.) It was true that the Minutemen were low on ammunition, and that their muskets were old and inaccurate and billowed a lot of smoke. So it was important to let the British get very close before they fired to be as effective as possible.
It was not until mid-afternoon that the British began their attack. The British attacked Breed's Hill twice but were driven back each time by the Minutemen. The third time the British attacked, the Minutemen retreated, mostly because they were out of ammunition, and also because the British muskets had bayonets and most of the colonial muskets did not. In hand to hand combat, the Minutemen were at a great disadvantage.
So the British won, but it was very costly for them in terms of lost men and reputation. The British lost over 200 men with another 800 wounded, which was nearly half their force. The colonials also lost men, but their losses were much less.
This battle gave heart to the colonial patriots and their cause.
This battle was misnamed "Battle of Bunker Hill", instead of Battle of Breed's Hill, and signaled the beginning of the end of British control in North America.