Likewise with plywood, most (but not all) plywood sold in the US is actually slightly undersized. 3/4" is normally 23/32" thick, 1/2" is normally 15/32" thick, etc. This isn't because the wood shrunk (though again plywood will slightly expand/contract depending on the moisture of the environment), it's because the manufacturers meant it to be a little thinner.
There are still manufacturing tolerances for both types of products, but the lumber mills know what they are doing, they know what their customers require and provide tolerances that match those. Just imagine one very common usage: a deck. You think deck builders would be happy if the dimensional lumber wasn't a) very consistently the same thickness and b) very consistently the same width? Otherwise you'd have a very bumpy deck that looked pretty irregular.
Today, a "2×4" board starts out as something smaller than 2 inches by 4 inches and not specified by standards, and after drying and planing is reliably 1 1⁄2 by 3 1⁄2 inches (38 mm × 89 mm).
1: https://en.wikipedia.org/wiki/Lumber#North_American_softwood...
Unplaned 2x5 measures exactly 2" x 5" Planed 2x3 measures 1 15/16" x 2 13/16" Planed 2x4 measures 1 7/8" x 3 3/4"
I'm in Norway. Apparently it's country specific.