If you rebore you drill and ream the barrel to a larger size and take out all the old rifling. Then you cut new rifling to whatever twist you want (or your available tooling allows). Obviously this is labor intensive procedure. You also have to be careful that you don't overheat the barrel or otherwise cause stress that could result in the barrel "bending". Regular barrels are drilled, bored, reamed and rifled from a an over sized rod of steel.
once rifled they turned to the desired outside contour, threaded for the appropriate action and rough chambered. depending on procedure, action type and cartridge finish chambering is done once the nearly finished barrel is fastened into the action. Please note there is plenty of "meat" to help withstand the stress of drilling, boring and rifling. I would also note that most rifle factories had barrel straightening machines.
A few skilled, experienced workers could bend barrels to make them straight when nearly done.
When you rechamber that is usually the only part of the barrel that is touched (although recrowning may be done) , you cut a bigger chamber that the barrel was originally manufactured with.
Times and labor costs change. At one time it was somewhat common to have a well used rifle with a shot out throat "rechambered" to bring it back into spec. The gunsmith (or home machinist) took the barrel off, cut one or two threads off, cut a new shoulder on the barrel and cut one or two new turns of thread. The barrel was reinstalled and a chambering reamer cut the shortened chamber back to full length and hopefully this move the start of the rifling that much closer to the chamber, restoring accuracy.
I hope I have explained that correctly and at least somewhat clearly.
This has fallen out of favor as you don't really get a new barrel or barrel surface in front of the chamber. The rifling is a bit worn or at least rounded off and you have microscopic cracks or checks in the surface of the steel from thousands of shots that aren't there on a new barrel. This "rechambering" job won't have the same life (number of shots fired) before accuracy falls of again. If you are paying modern gunsmith labor prices and not doing the work yourself the labor cost of this "repair" is about the same as fitting a new barrel. And if the new barrel lasts twice as long then the cost per shot in barrel wear comes out about the same. New barrel lasts 5000 shots while the "rechamber" lasts 2500 rounds for example.
recrowning is taking a skim cut across the muzzle to eliminate any defects (dents/burrs) and then chamfering the ends of the rifling, this depends on the gunsmiths and customers beliefs are there are several schools and techniques
If you are rechambering a rifle to a different cartridge (larger case) you are stuck with the rifling in the existing barrel. A lot of times this is no big deal but in some cases it leads to restricted bullet choices.