Geoguy has pretty much put it in a good nutshell.
Wood expands mostly WIDTHWISE, not LENGTHWISE. This expansion is a factor of humidity differences, width of the panel involved, species of wood, amongst other things.
You can glue narrow things like frames, molding, edging, and so on because the width of the pieces involved makes the expansion/contraction factor negligible.
Once you get into wider pieces (panels, table tops, etcetera) you need to take this into consideration. There are many, many techniques for handling this aspect of woodworking - from breadboard ends (which notably include SLOTS for the screws - thus allowing movement) to over sized pilot holes - once again allowing movement - to "undersized" panels - once again allowing movement. The key is to allow the movement to happen without breaking apart the furniture. You can't stop it - you just have to deal with it.
Just about any good woodworking book will discuss this in detail - have a look in your local library. You'll eventually find a text that you like and can refer to easily - buy that text and put it in your own library for easy reference. I'd make recommendations, but they'd only reflect my own tastes and methods - not necessarily yours.