A very open question. The answer is that sometimes we can minimize, sometimes we can prevent, and sometimes the wood does what it wants to do.
Are you asking about rough sawn lumber, of final dimensioned boards?
Wood cracks due to a change of moisture. Sometimes by losing moisture, but can also be due to gaining.
All wood has a moisture content. The mill or the store may have a stamp of the moisture level, e.g., "SD" - Surface Dry. This is < 19% moisture which is a lot more than most shops or houses. My PA location may have a relative humidity which equates to 6% - 11% moisture depending on the season.
For rough sawn lumber, sealing the ends helps to slow/control the loss of moisture to minimze cracking. Lots of threads on the site for methods of sealing.
Someone recently asked about a 3ft diameter horizontal slice from a tree. Such a large piece will be difficult to prevent cracking, also called checking, even if the piece is sealed.
For final dimensioned lumber, if this was done with boards which have a higher moisture content than you shop or house, the wood will lose moisture to try and reach the same moisture content as the air in your home or shop. Sometimes this can result in cracking.
If the dimensioned lumber has been glue into some project and is higher in moisture than the house, it will also lose moisture and shrink or "move". If the project is large enough the movement can be e.g. 1/8in and if the design did not allow for the movement, cracks will happen. As humidity (moisture) increases the cracks will appear to close, but they will still exist, they just may not be so easy to spot.