When buying a home, your bank has had the house appraised and the real estate agent has had it inspected to pass code. As important as those processes are, they are designed to protect other interests than your own. A separate inspection conducted on your behalf is the best way to protect your own security in what is likely the largest investment you've ever made.
Code Inspection Regulations
Code regulations and standards are not designed to protect the homeowner, rather they protect the house as a potential investment and the surrounding neighborhood. Electrical inspections assure there is no fire hazard which could endanger the people who live nearby but does not assure you have plugs where you may need them. Structural inspections assure the house isn't going to fall in and prevent you from paying back the loan, but doesn't check to make sure the garage is wide enough to store both your boat and your motorcycle. The inspection conducted on your behalf is when a privately contracted inspector goes through the house with your interests in mind to make sure those little details aren't overlooked and the house will in fact be suitable for the needs of you and your family.
Appraisal Point of View
Although they seem the same and utilize the same method of approach, appraisals are in no way meant to be an inspection. An appraisal only determines the value of what is there without regard to whether or not the home is even appropriate as a living situation. You may often get a great deal and buy the house for less than it is worth, or you may decide you love a particular house and pay a little more than its real value, either of which situation is fine according to what you determine the house is worth to you and your family. Either way, you do need to know the real value of the house in order to know how to manage your loan and what you need for insurance to protect your investment.
Private Inspections and Your Protection
When you buy or sell a house, it's going to undergo multiple home inspections. Don't let such a process fool you. The inspection which is important is the one done on your behalf, with your interests in mind. No inspector working for the bank, the city or county, or the other party involved in the sale cares about your interests; you have to bring in your own home inspector.