An appraisal is an independent, professional opinion of a property's market value. The lender orders it (you pay for it, usually $600–$800) to make sure the home is worth at least what you're borrowing against it.
If the appraisal comes in lower than the contract price, you have options: renegotiate the price with the seller, bring more cash to make up the gap, dispute the appraisal with comparable sales, or walk away (if your contract has an appraisal contingency).
Some refinances qualify for an appraisal waiver — the lender accepts an automated valuation instead, saving you the fee and a week of waiting. Waivers are common on rate-and-term refinances of well-documented properties.