The main problem with adopting breechloading technology was how to make the breech gas tight, so that it would not leak gases out of the sealed end of the barrel. One of the early breechloading weapons was actually a rifle -- The Ferguson Rifle, which we already discussed in the breechloading article linked above. However, it was not until the mid 19th century, when manufacturing technologies were sufficiently advanced, that the breechloader was considered again. We've also seen some of the 19th century breechloaders while discussing the needle gun cartridge. Both the Dreyse Needle Gun and the Chassepot were also rifled arms.
In breechloading weapons (including modern pistols, rifles etc.), the cartridge is loaded into a chamber at the breech (i.e.) close to the end of the barrel near the trigger. The chamber is somewhat larger than the bullet, so that the cartridge can be easily loaded into it. The chamber then narrows down to a throat which connects to the barrel. Normally, the diameter of the throat is roughly around the same diameter of the barrel with the grooves. The bullet is usually slightly larger in diameter than the diameter of the barrel with the grooves. When the weapon is fired, the bullet gets slightly deformed as it moves through the throat and enters the barrel. The deformation makes the bullet engage the grooves of the barrel and it starts to spin as it makes its way out of the barrel.
As black powder gave way to more powerful explosives such as cordite, the velocity of bullets increased and so it was no longer possible to manufacture them out of soft lead. Hence, we now have harder lead and copper jacketed bullets. These are made to prevent the bullet from being stripped by the grooves as it makes its way through the barrel.
As the bullets make their way out of the barrel, they tend to wear out the rifling. The maximum wear is usually around the chamber throat area where the chamber transits into the rifled barrel, as the pressure is highest in this area. Because heat can also wear out and deform the rifling, many light, medium and heavy machine guns have quick-change barrels, so that one barrel can be given sufficient time to cool down while another is used to fire the bullets.