One of the best ways to keep clothes wrinkle free is to travel with them stored in plastic bags, such dry-cleaner bags. This will eliminate friction between clothing and will keep your folding from undoing itself. The reduction in friction will also help make the process of loading and unloading your backpack simpler.
Keep your packing tight, but not stuffed. Have everything in a position where it will not shift. Keep bulkier clothing, such as jackets, at the bottom of your backpack and use balled-up socks to fill holes that your clothes might shift into.
For button-up shirts or T-shirts, stack a few in a neat pile, then fold all the shirts together. The shirts folded into the center of the mass are less likely to come unfolded in your backpack.
Rolling clothes is especially useful for pants. Simply fold them in half, then roll them up from the bottom. Rolled clothes are easily stacked and are very unlikely to wrinkle. For shirts, first fold in half down the middle, then fold in the sleeves. Roll shirts from the top to keep the sleeves bunched in toward the center of the roll.
Packing your backpack correctly can both balance your load and ensure that items inside won't unfold themselves. Try to pack with your heaviest items, such as jackets or jeans, low and toward your back. This will keep your clothing closer to your center of gravity, while also preventing the other items in your backpack from shifting.
The type of backpack you use can also have a bearing on the clothing you pack. A soft-side backpack without much structure is more likely to get twisted and contorted, doing the same to the clothes you are carrying with you. Using a stiffer traveling rucksack or a hiking backpack with an internal metal frame can help you carry more weight more comfortably, and will also keep your load from shifting as much. Choosing a backpack with compression straps can be especially important, since cinching the straps down will help keep your gear compact and firmly packed inside your backpack.