Well actually "perfectly straight" means that the dimensions remain the same. I used to work in a reman mill and rough cut lumber could easily vary a half inch to an inch in either width or depth. Imagine what a sheetrocked wall would look like with lumber varying in between 3.5 and 4.25 in depth. Back in the good old days of full dimension rough cut lumber walls were covered in lath and plaster which could be varied it thickness to hide most variations.
Lumber is a natural product and variations in bow and twist are the natural result. The best way to minimize this to have a slow drying process. WE used to air dry some lumber for over a year before it was milled. Even so when we made a small moulding out of 1x4, dividing into three separate pieces, the three pieces would sometimes curve in three different directions even though it had been a nice straight piece of CVG fir going it.