A 2×4 is not actually 2 inches by 4 inches because of the way lumber is processed and standardized. The dimensions of a piece of lumber refer to its nominal size, which is its size before it is planed and smoothed.
When a 2×4 is first cut from a log, it is indeed close to 2 inches by 4 inches. This is the rough-cut size of the lumber.
After the rough cut, the wood is dried, either in a kiln or through air-drying. During the drying process, the wood shrinks. After drying, the lumber is planed (smoothed and squared), which further reduces its dimensions.
The final size of a standard 2×4 is actually 1.5 inches by 3.5 inches. This is the size after all the processing is complete. The standard dimensions have been agreed upon to ensure uniformity and consistency in the building industry.
Historically, the dimensions of lumber have changed over time. Originally, a 2×4 might have been closer to its nominal size, but as processing techniques evolved and the need for standardization increased, the dimensions became smaller and more consistent.
In summary, the nominal dimensions (2×4) are based on the size of the lumber before drying and planing, whereas the actual dimensions (1.5×3.5) are the result of the standard processing methods used in the lumber industry.