Since the early 20th century, this specific type of muscle soreness, called “delayed onset muscle soreness” (DOMS), was thought to be cause by lactic acid buildup in the muscles during strenuous workouts where your body’s oxygen supply is depleted. Recent research has shown this is not the case at all and has even shown that lactic acid is actually used by your muscles for fuel when oxygen supplies are depleted.
So if it’s not lactic acid that is causing this soreness, what is it? Delayed onset muscle soreness (DOMS) is now understood to be caused by microfractures in the muscle cells themselves.This happens when you do some activity that your muscles aren’t used to doing or do it in a much more strenuous way than they are used to.
This is also why after you exercise some specific way a few times and allow your muscles to recover, that you won’t typically get sore again from doing that activity at a similar intensity level, so long as you continue to do it on a somewhat regular bases. The muscles quickly adapt to being able to handle new activities so as to avoid further damage in the future; this is known as the “repeated-bout effect”. When this happens, the microfractures typically won’t develop unless you change your activity in some substantial way. As a general rule, as long as the change to the exercise is under 10% of what you normally do, you won’t experience DOMS as a result of the activity.
Source1, Source2, Source3, Source4, Source5